Fix AssertionError in test_rand_password_with_len_2
This commit fixes the AssertionError in test_rand_password_with_len_2.
We were thinking an error could be happened but it's really rare.
However, it was actually happened[1]. To make the test more stable,
we shouldn't check its value but only length. It should be enough
because we already checked values in the other test cases.
[1] http://paste.openstack.org/show/625330/
Change-Id: I9a11a56e5eee9d1b01b61c04ea4bc75037c4458e
diff --git a/tempest/tests/lib/common/utils/test_data_utils.py b/tempest/tests/lib/common/utils/test_data_utils.py
index ab7fa74..b8385b2 100644
--- a/tempest/tests/lib/common/utils/test_data_utils.py
+++ b/tempest/tests/lib/common/utils/test_data_utils.py
@@ -79,7 +79,11 @@
self.assertEqual(len(actual), 3)
self.assertRegex(actual, "[A-Za-z0-9~!@#%^&*_=+]{3}")
actual2 = data_utils.rand_password(2)
- self.assertNotEqual(actual, actual2)
+ # NOTE(masayukig): Originally, we checked that the acutal and actual2
+ # are different each other. But only 3 letters can be the same value
+ # in a very rare case. So, we just check the length here, too,
+ # just in case.
+ self.assertEqual(len(actual2), 3)
def test_rand_url(self):
actual = data_utils.rand_url()