tests: Allow alternative error code for backupkey test
authorGarming Sam <garming@catalyst.net.nz>
Mon, 22 Feb 2016 21:59:15 +0000 (10:59 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 9 Mar 2016 09:32:16 +0000 (10:32 +0100)
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 <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/torture/rpc/backupkey_heimdal.c

index 9c388c0f608063ddd4df96b223202ae06054f9d7..b8f6ea0eeac51aac985d2649a2142aa6fc89feb2 100644 (file)
@@ -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),