Skip to content

Commit

Permalink
Merge pull request #1960 from arenadata/develop
Browse files Browse the repository at this point in the history
Release 2022.08.10
  • Loading branch information
kuhella authored Aug 10, 2022
2 parents 5445bf5 + 58ce72c commit b238598
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ unittests: basetests test_image ## Run unittests
pytest: ## Run functional tests
docker pull hub.adsw.io/library/functest:3.8.6.slim.buster-x64
docker run -i --rm --shm-size=4g -v /var/run/docker.sock:/var/run/docker.sock --network=host \
-v $(CURDIR)/:/adcm -v ${LDAP_CONF_FILE}:${LDAP_CONF_FILE} -w /adcm/ \
-v $(CURDIR)/:/adcm -w /adcm/ \
-e BUILD_TAG=${BUILD_TAG} -e ADCMPATH=/adcm/ -e PYTHONPATH=${PYTHONPATH}:python/ \
-e SELENOID_HOST="${SELENOID_HOST}" -e SELENOID_PORT="${SELENOID_PORT}" \
hub.adsw.io/library/functest:3.8.6.slim.buster-x64 /bin/sh -e \
./pytest.sh -m "not full and not extra_rbac" --adcm-image='hub.adsw.io/adcm/adcm:$(subst /,_,$(BRANCH_NAME))' \
--ldap-conf ${LDAP_CONF_FILE}
./pytest.sh -m "not full and not extra_rbac and not ldap" \
--adcm-image='hub.adsw.io/adcm/adcm:$(subst /,_,$(BRANCH_NAME))'

pytest_release: ## Run functional tests on release
docker pull hub.adsw.io/library/functest:3.8.6.slim.buster.firefox-x64
Expand Down
2 changes: 1 addition & 1 deletion conf/adcm/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

type: adcm
name: ADCM
version: 1.8
version: 1.9

actions:
run_ldap_sync:
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/ldap_auth/test_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from tests.functional.ldap_auth.utils import get_ldap_user_from_adcm, get_ldap_group_from_adcm
from tests.functional.rbac.conftest import is_denied, BusinessRoles, create_policy, is_allowed, delete_policy

pytestmark = [only_clean_adcm, pytest.mark.usefixtures('configure_adcm_ldap_ad')]
pytestmark = [only_clean_adcm, pytest.mark.usefixtures('configure_adcm_ldap_ad'), pytest.mark.ldap()]


# pylint: disable=redefined-outer-name
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/ldap_auth/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
login_should_fail,
)

pytestmark = [only_clean_adcm, pytest.mark.usefixtures('configure_adcm_ldap_ad')]
pytestmark = [only_clean_adcm, pytest.mark.usefixtures('configure_adcm_ldap_ad'), pytest.mark.ldap()]


@pytest.mark.parametrize('configure_adcm_ldap_ad', [False, True], ids=['ssl_off', 'ssl_on'], indirect=True)
Expand Down
2 changes: 2 additions & 0 deletions tests/functional/ldap_auth/test_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
UserInfo = dict
GroupInfo = dict

pytestmark = [pytest.mark.ldap()]


@pytest.fixture()
def two_ldap_groups_with_users(ldap_ad, ldap_basic_ous) -> Tuple[GroupInfo, UserInfo, GroupInfo, UserInfo]:
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/ldap_auth/test_modification.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

# pylint: disable=redefined-outer-name

pytestmark = [only_clean_adcm, pytest.mark.usefixtures('configure_adcm_ldap_ad')]
pytestmark = [only_clean_adcm, pytest.mark.usefixtures('configure_adcm_ldap_ad'), pytest.mark.ldap()]


@pytest.fixture()
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/ldap_auth/test_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from tests.functional.ldap_auth.utils import get_ldap_user_from_adcm, get_ldap_group_from_adcm
from tests.library.ldap_interactions import LDAPEntityManager

pytestmark = [only_clean_adcm, pytest.mark.usefixtures('configure_adcm_ldap_ad')]
pytestmark = [only_clean_adcm, pytest.mark.usefixtures('configure_adcm_ldap_ad'), pytest.mark.ldap()]


# pylint: disable-next=too-few-public-methods
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/ldap_auth/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

# pylint: disable=redefined-outer-name

pytestmark = [only_clean_adcm]
pytestmark = [only_clean_adcm, pytest.mark.ldap()]


@pytest.fixture()
Expand Down
1 change: 1 addition & 0 deletions tests/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ markers =
regression: mark a test/module that tests known bug
only_clean_adcm: mark a test/module to run it only with clean ADCM
extra_rbac: mark an RBAC related test/module to exclude it from full run
ldap: ADCM-LDAP integration related tests
include_firefox: test given ui test case on both Chrome and Firefox browsers
5 changes: 4 additions & 1 deletion tests/ui_tests/test_admin_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def test_reset_config(self, settings_page: AdminSettingsPage):
settings_page.config.reset_to_default(config_field_row)
settings_page.config.assert_input_value_is(params['init_value'], params['field_display_name'])

# TODO add mark during ADCM-2967
@pytest.mark.ldap()
def test_ldap_config(self, settings_page: AdminSettingsPage):
"""Test ldap"""
params = {'test_action': "Test LDAP connection", 'connect_action': "Run LDAP sync", "test_value": "test"}
Expand Down Expand Up @@ -353,6 +353,7 @@ def test_change_admin_password(self, users_page: AdminUsersPage):
with allure.step('Check login was successful'):
AdminIntroPage(users_page.driver, users_page.base_url).wait_page_is_opened(timeout=5)

@pytest.mark.ldap()
@pytest.mark.usefixtures("configure_adcm_ldap_ad")
def test_ldap_user_change_is_forbidden(self, users_page: AdminUsersPage, ldap_user_in_group):
"""Change ldap user"""
Expand Down Expand Up @@ -508,6 +509,7 @@ def test_delete_group_from_groups_page(self, app_fs):
with allure.step('Check that group has been deleted'):
assert len(page.table.get_all_rows()) == 0, "There should be 0 groups"

@pytest.mark.ldap()
@pytest.mark.usefixtures("configure_adcm_ldap_ad")
def test_ldap_group_change_is_forbidden(self, app_fs, ldap_user_in_group):
"""Change ldap group"""
Expand All @@ -521,6 +523,7 @@ def test_ldap_group_change_is_forbidden(self, app_fs, ldap_user_in_group):
), f"Group {params['group_name']} should be in groups list"
groups_page.check_ldap_group(params['group_name'])

@pytest.mark.ldap()
@pytest.mark.usefixtures("configure_adcm_ldap_ad")
def test_add_ldap_user_to_group(self, app_fs, ldap_user_in_group):
"""Add ldap user to group"""
Expand Down
1 change: 1 addition & 0 deletions tests/ui_tests/test_login_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def test_check_login_to_adcm(app_fs, adcm_credentials):
intro_page.header.check_auth_page_elements()


@pytest.mark.ldap()
@including_https
@pytest.mark.parametrize("configure_adcm_ldap_ad", [False, True], ids=["ssl-off", "ssl-on"], indirect=True)
@pytest.mark.usefixtures("configure_adcm_ldap_ad")
Expand Down

0 comments on commit b238598

Please sign in to comment.