]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
torture/backupkey: Fix flapping test
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 28 Feb 2023 22:37:03 +0000 (11:37 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 3 Mar 2023 01:07:36 +0000 (01:07 +0000)
UNEXPECTED(failure): samba4.rpc.backupkey with seal.backupkey.server_wrap_decrypt_wrong_r2(ad_dc_default)
REASON: Exception: Exception: ../../source4/torture/rpc/backupkey.c:2219: r.out.result was WERR_INVALID_ACCESS, expected WERR_INVALID_PARAMETER: decrypt should fail with WERR_INVALID_PARAMETER

As commit 664bde19bf1db1b3740621cdf3f46f9bfd0e8452 states:

"The use of the wrong key can still create structures that parse as a
SID, therefore we can sometimes get an unusual error, which becomes a
flapping test".

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12107

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/torture/rpc/backupkey.c

index c84e62883be04159cf4aeef1de856d33f53334af..8d932316ded456ddd2a1330955e82295ae973524 100644 (file)
@@ -2216,10 +2216,12 @@ static bool test_ServerWrap_decrypt_wrong_stuff(struct torture_context *tctx,
                                          WERR_INVALID_ACCESS,
                                          "decrypt should fail with WERR_INVALID_ACCESS");
        } else {
-               torture_assert_werr_equal(tctx,
-                                         r.out.result,
-                                         WERR_INVALID_PARAMETER,
-                                         "decrypt should fail with WERR_INVALID_PARAMETER");
+               if (!W_ERROR_EQUAL(r.out.result, WERR_INVALID_ACCESS)
+                   && !W_ERROR_EQUAL(r.out.result, WERR_INVALID_PARAMETER)) {
+                       torture_assert_werr_equal(tctx, r.out.result,
+                                                 WERR_INVALID_DATA,
+                                                 "decrypt should fail with WERR_INVALID_ACCESS, WERR_INVALID_PARAMETER or WERR_INVALID_DATA");
+               }
        }
 
        return true;