summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Styk <mastyk@redhat.com>2019-04-26 11:05:52 +0200
committerMartin Styk <mastyk@redhat.com>2019-04-30 07:50:08 +0000
commitc4a029887858f4970cb287c2550972f05896a5a8 (patch)
treed936f256171038990c6ea1c91abeab1343d4325c
parentfafc3b1869ec789f373f6df004a52582145b80d7 (diff)
Update verification in inttests for PWQuality out
Unnecessary imports were removed + reorganized Bug: 1703367 Change-Id: I221073ea99289f4f0b0caf0c56c45632dc1214c4 Signed-off-by: Martin Styk <mastyk@redhat.com>
-rw-r--r--IntegrationTests/src/bkr/inttest/client/test_group_create.py17
-rw-r--r--IntegrationTests/src/bkr/inttest/client/test_group_modify.py17
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_group_edit.py28
3 files changed, 37 insertions, 25 deletions
diff --git a/IntegrationTests/src/bkr/inttest/client/test_group_create.py b/IntegrationTests/src/bkr/inttest/client/test_group_create.py
index 0cbffc8..cf0e2d6 100644
--- a/IntegrationTests/src/bkr/inttest/client/test_group_create.py
+++ b/IntegrationTests/src/bkr/inttest/client/test_group_create.py
@@ -4,13 +4,16 @@
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
-from turbogears.database import session
+import re
+
from turbogears import config
+from turbogears.database import session
from unittest2 import SkipTest
-from bkr.server.model import Group, GroupMembershipType, User
+
from bkr.inttest import data_setup
-from bkr.inttest.client import run_client, ClientError, create_client_config, \
- ClientTestCase
+from bkr.inttest.client import run_client, ClientError, create_client_config, ClientTestCase
+from bkr.server.model import Group, GroupMembershipType, User
+
class GroupCreateTest(ClientTestCase):
@@ -127,8 +130,10 @@ class GroupCreateTest(ClientTestCase):
group_name])
self.fail('Expected to fail due to short password')
except ClientError, e:
- self.assertTrue('The group root password is shorter than 7 characters' in e.stderr_output,
- e.stderr_output)
+ # Number of req chars was changed in RPM, however RHEL is using older one
+ # RHEL requires 7, Fedora requires 8 at this moment
+ self.assertTrue(
+ re.search('The group root password is shorter than . characters', str(e)))
try:
out = run_client(['bkr', 'group-create',
diff --git a/IntegrationTests/src/bkr/inttest/client/test_group_modify.py b/IntegrationTests/src/bkr/inttest/client/test_group_modify.py
index 606879f..402467c 100644
--- a/IntegrationTests/src/bkr/inttest/client/test_group_modify.py
+++ b/IntegrationTests/src/bkr/inttest/client/test_group_modify.py
@@ -5,13 +5,15 @@
# (at your option) any later version.
import email
-import crypt
-from bkr.inttest import data_setup, with_transaction, mail_capture_thread
-from bkr.inttest.client import run_client, ClientError, create_client_config, \
- ClientTestCase
-from bkr.server.model import Group, Activity, User, GroupMembershipType
+import re
+
from turbogears.database import session
+from bkr.inttest import data_setup, mail_capture_thread
+from bkr.inttest.client import run_client, ClientError, create_client_config, ClientTestCase
+from bkr.server.model import Group, Activity, GroupMembershipType
+
+
class GroupModifyTest(ClientTestCase):
def setUp(self):
@@ -195,7 +197,10 @@ class GroupModifyTest(ClientTestCase):
self.group.group_name], config=self.client_config)
self.fail('Should fail with short password')
except ClientError, e:
- self.assertTrue('The group root password is shorter than 7 characters' in str(e))
+ # Number of req chars was changed in RPM, however RHEL is using older one
+ # RHEL requires 7, Fedora requires 8 at this moment
+ self.assertTrue(
+ re.search('The group root password is shorter than . characters', str(e)))
session.expire(self.group)
with session.begin():
group = self.group
diff --git a/IntegrationTests/src/bkr/inttest/server/selenium/test_group_edit.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_group_edit.py
index bfda97e..64f7596 100644
--- a/IntegrationTests/src/bkr/inttest/server/selenium/test_group_edit.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_group_edit.py
@@ -4,22 +4,22 @@
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
-import datetime
import crypt
+import email
+import re
+
+import datetime
import requests
import xmlrpclib
from turbogears.database import session
-from bkr.server.model import Group, User, Activity, UserGroup, \
- SystemPermission, GroupMembershipType
+
+from bkr.inttest import data_setup, get_server_base, mail_capture_thread, DatabaseTestCase
+from bkr.inttest.server.requests_utils import post_json, patch_json, login as requests_login
from bkr.inttest.server.selenium import WebDriverTestCase, XmlRpcTestCase
-from bkr.inttest import data_setup, get_server_base, with_transaction, \
- mail_capture_thread, DatabaseTestCase
-from bkr.inttest.server.webdriver_utils import login, logout, \
- wait_for_animation, check_group_search_results, BootstrapSelect
-from bkr.inttest.assertions import wait_for_condition
-from bkr.inttest.server.requests_utils import put_json, post_json, \
- patch_json, login as requests_login
-import email
+from bkr.inttest.server.webdriver_utils import (login, logout, check_group_search_results,
+ BootstrapSelect)
+from bkr.server.model import Group, User, Activity, SystemPermission, GroupMembershipType
+
class TestGroupsWD(WebDriverTestCase):
@@ -137,8 +137,10 @@ class TestGroupsWD(WebDriverTestCase):
tab = b.find_element_by_id('rootpassword')
tab.find_element_by_name('root_password').send_keys('s3cr3t')
tab.find_element_by_tag_name('form').submit()
- self.assertIn('The group root password is shorter than 7 characters',
- tab.find_element_by_class_name('alert-error').text)
+ # Number of req chars was changed in RPM, however RHEL is using older one
+ # RHEL requires 7, Fedora requires 8 at this moment
+ self.assertTrue(re.search('The group root password is shorter than . characters',
+ tab.find_element_by_class_name('alert-error').text))
def test_dictionary_password_rejected(self):
b = self.browser