Test python binding for package_PackagesBlob
authorArvid Requate <requate@univention.de>
Wed, 3 May 2017 08:59:41 +0000 (10:59 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Feb 2019 11:55:14 +0000 (12:55 +0100)
Signed-off-by: Arvid Requate <requate@univention.de>
python/samba/tests/password_hash_fl2003.py
python/samba/tests/password_hash_fl2008.py
python/samba/tests/password_hash_gpgme.py

index ab99b3b1823e01d49ba25aab7892a1fbde744617..86592ddbac9f92350adb34333659d057a4b5357c 100644 (file)
@@ -69,6 +69,13 @@ class PassWordHashFl2003Tests(PassWordHashTests):
                              binascii.a2b_hex(package.data))
         self.check_wdigests(digests)
 
+        # Check that the Package names are correct.
+        #
+        pb = ndr_unpack(drsblobs.package_PackagesBlob,
+                             binascii.a2b_hex(package.data))
+        expected = ["Kerberos", "WDigest"]
+        self.assertEquals(expected, pb.names)
+
     def test_userPassword_sha256(self):
         self.add_user(options=[("password hash userPassword schemes",
                                 "CryptSHA256")])
index 917e973cdbcd8d14f82d3f7a00096949a481b3c2..90b9fd7372d137de1e24ddab66fe85a7cce640ca 100644 (file)
@@ -71,6 +71,13 @@ class PassWordHashFl2008Tests(PassWordHashTests):
                              binascii.a2b_hex(package.data))
         self.check_wdigests(digests)
 
+        # Check that the Package names are correct.
+        #
+        pb = ndr_unpack(drsblobs.package_PackagesBlob,
+                             binascii.a2b_hex(package.data))
+        expected = ["Kerberos-Newer-Keys", "Kerberos", "WDigest"]
+        self.assertEquals(expected, pb.names)
+
     def test_userPassword_sha512(self):
         self.add_user(options=[("password hash userPassword schemes",
                                 "CryptSHA512")])
index fa7b9b74cd3c399b499f75fe6fe29814cca9450c..6f27821a8e5c1830c4ac760f7c83a3854bd9814b 100644 (file)
@@ -47,7 +47,7 @@ class PassWordHashGpgmeTests(PassWordHashTests):
         self.add_user()
         if not self.lp.get("password hash gpg key ids"):
             self.skipTest("No password hash gpg key ids, " +
-                          "Primary:SambaGPG will not be generated");
+                          "Primary:SambaGPG will not be generated")
 
         sc = self.get_supplemental_creds()
 
@@ -81,11 +81,18 @@ class PassWordHashGpgmeTests(PassWordHashTests):
                              binascii.a2b_hex(wd_package.data))
         self.check_wdigests(digests)
 
+        # Check that the Package names are correct.
+        #
+        pb = ndr_unpack(drsblobs.package_PackagesBlob,
+                             binascii.a2b_hex(package.data))
+        expected = ["Kerberos-Newer-Keys", "Kerberos", "WDigest", "SambaGPG"]
+        self.assertEquals(expected, pb.names)
+
     def test_supplementalCredentials_cleartext(self):
         self.add_user(clear_text=True)
         if not self.lp.get("password hash gpg key ids"):
             self.skipTest("No password hash gpg key ids, " +
-                          "Primary:SambaGPG will not be generated");
+                          "Primary:SambaGPG will not be generated")
 
         sc = self.get_supplemental_creds()