diff --git a/qa/qa_rapi.py b/qa/qa_rapi.py index df01788d1d8927a7e778dc2459f5f72126a7f40d..a1b371ef30024f6199c917495c8278aec61bc659 100644 --- a/qa/qa_rapi.py +++ b/qa/qa_rapi.py @@ -178,6 +178,24 @@ def TestEmptyCluster(): ("/2/os", None, 'GET', None), ]) + # Test HTTP Not Found + for method in ["GET", "PUT", "POST", "DELETE"]: + try: + _DoTests([("/99/resource/not/here/99", None, method, None)]) + except rapi.client.GanetiApiError, err: + AssertEqual(err.code, 404) + else: + raise qa_error.Error("Non-existent resource didn't return HTTP 404") + + # Test HTTP Not Implemented + for method in ["PUT", "POST", "DELETE"]: + try: + _DoTests([("/version", None, method, None)]) + except rapi.client.GanetiApiError, err: + AssertEqual(err.code, 501) + else: + raise qa_error.Error("Non-implemented method didn't fail") + def TestInstance(instance): """Testing getting instance(s) info via remote API.