ansible-2.9/skip-crypto-testscase.patch
cherry530 ac7f156577 Fixed testcase failure due to python-crypto removal
Signed-off-by: cherry530 <707078654@qq.com>
(cherry picked from commit a818ca24926ad38ed23c9287906064fe70940056)
2024-05-28 16:41:36 +08:00

61 lines
2.4 KiB
Diff

From b01f683aca986cc58b515aa02c7b3e67977b7bba Mon Sep 17 00:00:00 2001
From: xu_ping <707078654@qq.com>
Date: Wed, 15 Nov 2023 11:10:55 +0800
Subject: [PATCH] skip crypto testscase
Signed-off-by: xu_ping <707078654@qq.com>
---
test/units/parsing/vault/test_vault.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/test/units/parsing/vault/test_vault.py b/test/units/parsing/vault/test_vault.py
index c7d6b8d8..13d434e1 100644
--- a/test/units/parsing/vault/test_vault.py
+++ b/test/units/parsing/vault/test_vault.py
@@ -40,6 +40,7 @@ from ansible.parsing import vault
from units.mock.loader import DictDataLoader
from units.mock.vault_helper import TextVaultSecret
+skipmark = pytest.mark.skip(reason='crypto package is recycle')
class TestUnhexlify(unittest.TestCase):
def test(self):
@@ -510,7 +511,7 @@ class TestVaultCipherAes256(unittest.TestCase):
b_key_cryptography = self.vault_cipher._create_key_cryptography(b_password, b_salt, key_length=32, iv_length=16)
self.assertIsInstance(b_key_cryptography, six.binary_type)
- @pytest.mark.skipif(not vault.HAS_PYCRYPTO, reason='Not testing pycrypto key as pycrypto is not installed')
+ @skipmark
def test_create_key_pycrypto(self):
b_password = b'hunter42'
b_salt = os.urandom(32)
@@ -518,8 +519,7 @@ class TestVaultCipherAes256(unittest.TestCase):
b_key_pycrypto = self.vault_cipher._create_key_pycrypto(b_password, b_salt, key_length=32, iv_length=16)
self.assertIsInstance(b_key_pycrypto, six.binary_type)
- @pytest.mark.skipif(not vault.HAS_PYCRYPTO,
- reason='Not comparing cryptography key to pycrypto key as pycrypto is not installed')
+ @skipmark
def test_compare_new_keys(self):
b_password = b'hunter42'
b_salt = os.urandom(32)
@@ -528,6 +528,7 @@ class TestVaultCipherAes256(unittest.TestCase):
b_key_pycrypto = self.vault_cipher._create_key_pycrypto(b_password, b_salt, key_length=32, iv_length=16)
self.assertEqual(b_key_cryptography, b_key_pycrypto)
+ @skipmark
def test_create_key_known_cryptography(self):
b_password = b'hunter42'
@@ -555,6 +556,7 @@ class TestVaultCipherAes256(unittest.TestCase):
self.assertEqual(b_key_3, b_key_4)
self.assertEqual(b_key_1, b_key_4)
+ @skipmark
def test_create_key_known_pycrypto(self):
b_password = b'hunter42'
--
2.27.0