From: Garming Sam Date: Mon, 22 Feb 2016 21:59:15 +0000 (+1300) Subject: tests: Allow alternative error code for backupkey test X-Git-Tag: tdb-1.3.9~489 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42fe66fa732d824d62db4b35739fdbdc93bbb312;p=thirdparty%2Fsamba.git tests: Allow alternative error code for backupkey test It appears that incorrect decryption triggers a different error code, causing a test which fails every now and again, as sometimes the invalid data will parse as a SID, and so pass one of the checks. Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett --- diff --git a/source4/torture/rpc/backupkey_heimdal.c b/source4/torture/rpc/backupkey_heimdal.c index 9c388c0f608..b8f6ea0eeac 100644 --- a/source4/torture/rpc/backupkey_heimdal.c +++ b/source4/torture/rpc/backupkey_heimdal.c @@ -796,7 +796,11 @@ static bool test_RestoreGUID_ko(struct torture_context *tctx, out_blob.length = *r->out.data_out_len; ndr_err = ndr_pull_struct_blob(&out_blob, tctx, &resp, (ndr_pull_flags_fn_t)ndr_pull_bkrp_client_side_unwrapped); torture_assert_int_equal(tctx, NDR_ERR_CODE_IS_SUCCESS(ndr_err), 0, "Unable to unmarshall bkrp_client_side_unwrapped"); - torture_assert_werr_equal(tctx, r->out.result, WERR_INVALID_PARAM, "Wrong error code"); + if (!W_ERROR_EQUAL(r->out.result, WERR_INVALID_PARAM)) { + torture_assert_werr_equal(tctx, r->out.result, + WERR_INVALID_DATA, + "Wrong error code"); + } } else { struct bkrp_BackupKey *r = createRetrieveBackupKeyGUIDStruct(tctx, p, 2, &out_blob); torture_assert_ntstatus_equal(tctx, dcerpc_bkrp_BackupKey_r(b, tctx, r),