Commit cfb3116d authored by Helga Velroyen's avatar Helga Velroyen
Browse files

Activate QA for rapi queries via luxi



This patch enables QA testing for rapi queries for the
newly transformed queries from python to haskell
(groups, instances, nodes, export, and networks). So far,
the QA did not distinguish between resources that cannot be
queried with PUT requests, hence an additional distinction
between luxi-able and luxi-and-put-able resources was
necessary.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent c6013594
......@@ -322,22 +322,24 @@ def TestRapiQuery():
# Note the spaces
("/2/query/%s?fields=%s,%%20%s%%09,%s%%20" %
(what, namefield, namefield, namefield),
compat.partial(_Check, [namefield] * 3), "GET", None),
compat.partial(_Check, [namefield] * 3), "GET", None)])
# PUT with fields in query
("/2/query/%s?fields=%s" % (what, namefield),
compat.partial(_Check, [namefield]), "PUT", {}),
if what in constants.QR_VIA_RAPI_PUT:
_DoTests([
# PUT with fields in query
("/2/query/%s?fields=%s" % (what, namefield),
compat.partial(_Check, [namefield]), "PUT", {}),
("/2/query/%s" % what, compat.partial(_Check, [namefield] * 4), "PUT", {
"fields": [namefield] * 4,
}),
("/2/query/%s" % what, compat.partial(_Check, [namefield] * 4), "PUT", {
"fields": [namefield] * 4,
}),
("/2/query/%s" % what, compat.partial(_Check, all_fields), "PUT", {
"fields": all_fields,
}),
("/2/query/%s" % what, compat.partial(_Check, all_fields), "PUT", {
"fields": all_fields,
}),
("/2/query/%s" % what, compat.partial(_Check, [namefield] * 4), "PUT", {
"fields": [namefield] * 4
("/2/query/%s" % what, compat.partial(_Check, [namefield] * 4), "PUT", {
"fields": [namefield] * 4
})])
def _CheckFilter():
......@@ -358,7 +360,8 @@ def TestRapiQuery():
else:
raise qa_error.Error("Filtering locks didn't fail")
else:
_CheckFilter()
if what in constants.QR_VIA_RAPI_PUT:
_CheckFilter()
if what == constants.QR_NODE:
# Test with filter
......
......@@ -3352,7 +3352,11 @@ qrViaLuxi = ConstantUtils.mkSet [qrGroup,
-- | List of resources which can be queried using RAPI
qrViaRapi :: FrozenSet String
qrViaRapi = ConstantUtils.mkSet [qrLock, qrJob]
qrViaRapi = qrViaLuxi
-- | List of resources which can be queried via RAPI including PUT requests
qrViaRapiPut :: FrozenSet String
qrViaRapiPut = ConstantUtils.mkSet [qrLock, qrJob]
-- * Query field types
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment