From 0a64e9bd7061550b478be889b0e7fc90f560b06c Mon Sep 17 00:00:00 2001 From: Milan Kubik Date: Fri, 24 Apr 2015 14:39:48 +0200 Subject: Applied tier0 and tier1 marks on unit tests and xmlrpc tests Web UI tests were marked as tier1 tests. The tier system is intended to be used together with CI system to make sure the more complicated tests are being run only when all of the basic functionality is working. The system is using pytest's marker system. E.g. an invocation of all tier1 tests with listing will look like: $ py.test -v -m tier1 ipatests or in case of out of tree tests: $ ipa-run-tests -m tier1 Reviewed-By: Ales 'alich' Marecek --- ipatests/pytest.ini | 3 +++ ipatests/test_cmdline/test_cli.py | 2 ++ ipatests/test_cmdline/test_help.py | 2 ++ ipatests/test_cmdline/test_ipagetkeytab.py | 3 +++ ipatests/test_install/test_updates.py | 3 +++ ipatests/test_ipalib/test_aci.py | 4 ++++ ipatests/test_ipalib/test_backend.py | 2 ++ ipatests/test_ipalib/test_base.py | 4 ++++ ipatests/test_ipalib/test_capabilities.py | 3 +++ ipatests/test_ipalib/test_cli.py | 3 +++ ipatests/test_ipalib/test_config.py | 3 +++ ipatests/test_ipalib/test_crud.py | 3 +++ ipatests/test_ipalib/test_errors.py | 4 ++++ ipatests/test_ipalib/test_frontend.py | 4 ++++ ipatests/test_ipalib/test_messages.py | 3 +++ ipatests/test_ipalib/test_output.py | 4 ++++ ipatests/test_ipalib/test_parameters.py | 4 ++++ ipatests/test_ipalib/test_plugable.py | 3 +++ ipatests/test_ipalib/test_text.py | 3 +++ ipatests/test_ipalib/test_x509.py | 4 ++++ ipatests/test_ipapython/test_cookie.py | 4 ++++ ipatests/test_ipapython/test_dn.py | 4 ++++ ipatests/test_ipapython/test_ipap11helper.py | 1 + ipatests/test_ipapython/test_ipautil.py | 4 ++++ ipatests/test_ipapython/test_ipavalidate.py | 3 +++ ipatests/test_ipapython/test_keyring.py | 4 ++++ ipatests/test_ipapython/test_ssh.py | 3 +++ ipatests/test_ipaserver/test_changepw.py | 3 +++ ipatests/test_ipaserver/test_install/test_adtrustinstance.py | 3 +++ ipatests/test_ipaserver/test_install/test_service.py | 2 ++ ipatests/test_ipaserver/test_ldap.py | 3 +++ ipatests/test_ipaserver/test_otptoken_import.py | 1 + ipatests/test_ipaserver/test_rpcserver.py | 2 ++ ipatests/test_ipaserver/test_topology_plugin.py | 1 + ipatests/test_pkcs10/test_pkcs10.py | 3 +++ ipatests/test_util.py | 3 +++ ipatests/test_webui/test_automember.py | 2 ++ ipatests/test_webui/test_automount.py | 2 ++ ipatests/test_webui/test_cert.py | 2 ++ ipatests/test_webui/test_config.py | 2 ++ ipatests/test_webui/test_delegation.py | 2 ++ ipatests/test_webui/test_dns.py | 2 ++ ipatests/test_webui/test_group.py | 2 ++ ipatests/test_webui/test_hbac.py | 2 ++ ipatests/test_webui/test_host.py | 3 +++ ipatests/test_webui/test_hostgroup.py | 2 ++ ipatests/test_webui/test_krbtpolicy.py | 2 ++ ipatests/test_webui/test_navigation.py | 2 ++ ipatests/test_webui/test_netgroup.py | 2 ++ ipatests/test_webui/test_pwpolicy.py | 2 ++ ipatests/test_webui/test_range.py | 2 ++ ipatests/test_webui/test_rbac.py | 2 ++ ipatests/test_webui/test_realmdomains.py | 2 ++ ipatests/test_webui/test_selfservice.py | 2 ++ ipatests/test_webui/test_selinuxusermap.py | 2 ++ ipatests/test_webui/test_service.py | 3 +++ ipatests/test_webui/test_sudo.py | 2 ++ ipatests/test_webui/test_trust.py | 3 +++ ipatests/test_webui/test_user.py | 2 ++ ipatests/test_xmlrpc/test_add_remove_cert_cmd.py | 5 +++++ ipatests/test_xmlrpc/test_attr.py | 3 +++ ipatests/test_xmlrpc/test_automember_plugin.py | 2 ++ ipatests/test_xmlrpc/test_automount_plugin.py | 7 +++++++ ipatests/test_xmlrpc/test_baseldap_plugin.py | 5 +++++ ipatests/test_xmlrpc/test_batch_plugin.py | 2 ++ ipatests/test_xmlrpc/test_caacl_plugin.py | 3 +++ ipatests/test_xmlrpc/test_caacl_profile_enforcement.py | 4 ++++ ipatests/test_xmlrpc/test_cert_plugin.py | 5 +++++ ipatests/test_xmlrpc/test_certprofile_plugin.py | 4 ++++ ipatests/test_xmlrpc/test_config_plugin.py | 3 +++ ipatests/test_xmlrpc/test_delegation_plugin.py | 3 +++ ipatests/test_xmlrpc/test_dns_plugin.py | 7 +++++++ ipatests/test_xmlrpc/test_dns_realmdomains_integration.py | 2 ++ ipatests/test_xmlrpc/test_external_members.py | 2 ++ ipatests/test_xmlrpc/test_group_plugin.py | 6 ++++++ ipatests/test_xmlrpc/test_hbac_plugin.py | 3 +++ ipatests/test_xmlrpc/test_hbacsvcgroup_plugin.py | 2 ++ ipatests/test_xmlrpc/test_hbactest_plugin.py | 4 ++++ ipatests/test_xmlrpc/test_host_plugin.py | 10 ++++++++++ ipatests/test_xmlrpc/test_hostgroup_plugin.py | 2 ++ ipatests/test_xmlrpc/test_idviews_plugin.py | 2 ++ ipatests/test_xmlrpc/test_krbtpolicy.py | 5 ++++- ipatests/test_xmlrpc/test_nesting.py | 2 ++ ipatests/test_xmlrpc/test_netgroup_plugin.py | 3 +++ ipatests/test_xmlrpc/test_old_permission_plugin.py | 3 +++ ipatests/test_xmlrpc/test_passwd_plugin.py | 2 ++ ipatests/test_xmlrpc/test_permission_plugin.py | 11 +++++++++++ ipatests/test_xmlrpc/test_ping_plugin.py | 2 ++ ipatests/test_xmlrpc/test_privilege_plugin.py | 2 ++ ipatests/test_xmlrpc/test_pwpolicy_plugin.py | 4 ++++ ipatests/test_xmlrpc/test_radiusproxy_plugin.py | 2 ++ ipatests/test_xmlrpc/test_range_plugin.py | 2 ++ ipatests/test_xmlrpc/test_realmdomains_plugin.py | 2 ++ ipatests/test_xmlrpc/test_replace.py | 2 ++ ipatests/test_xmlrpc/test_role_plugin.py | 3 +++ ipatests/test_xmlrpc/test_selfservice_plugin.py | 3 +++ ipatests/test_xmlrpc/test_selinuxusermap_plugin.py | 2 ++ ipatests/test_xmlrpc/test_service_plugin.py | 5 +++++ ipatests/test_xmlrpc/test_servicedelegation_plugin.py | 2 ++ ipatests/test_xmlrpc/test_stageuser_plugin.py | 9 +++++++++ ipatests/test_xmlrpc/test_sudocmd_plugin.py | 2 ++ ipatests/test_xmlrpc/test_sudocmdgroup_plugin.py | 3 +++ ipatests/test_xmlrpc/test_sudorule_plugin.py | 2 ++ ipatests/test_xmlrpc/test_trust_plugin.py | 3 +++ ipatests/test_xmlrpc/test_user_plugin.py | 3 +++ ipatests/test_xmlrpc/test_vault_plugin.py | 2 ++ 106 files changed, 323 insertions(+), 1 deletion(-) diff --git a/ipatests/pytest.ini b/ipatests/pytest.ini index a24466a2a..95932270a 100644 --- a/ipatests/pytest.ini +++ b/ipatests/pytest.ini @@ -23,3 +23,6 @@ addopts = --doctest-modules --ignore=install/share/wsgi.py --ignore=ipapython/py_default_encoding/setup.py --ignore=ipapython/ipap11helper/setup.py +markers = + tier0: basic unit tests and critical functionality + tier1: functional API tests diff --git a/ipatests/test_cmdline/test_cli.py b/ipatests/test_cmdline/test_cli.py index 74a7c6ca4..c2203e68f 100644 --- a/ipatests/test_cmdline/test_cli.py +++ b/ipatests/test_cmdline/test_cli.py @@ -9,11 +9,13 @@ from six import StringIO from ipatests import util from ipalib import api, errors from ipapython.version import API_VERSION +import pytest if six.PY3: unicode = str +@pytest.mark.tier0 class TestCLIParsing(object): """Tests that commandlines are correctly parsed to Command keyword args """ diff --git a/ipatests/test_cmdline/test_help.py b/ipatests/test_cmdline/test_help.py index cdbfd8ea9..fee942007 100644 --- a/ipatests/test_cmdline/test_help.py +++ b/ipatests/test_cmdline/test_help.py @@ -26,11 +26,13 @@ from six import StringIO from ipalib import api, errors from ipalib.plugins.user import user_add +import pytest if six.PY3: unicode = str +@pytest.mark.tier0 class CLITestContext(object): """Context manager that replaces stdout & stderr, and catches SystemExit diff --git a/ipatests/test_cmdline/test_ipagetkeytab.py b/ipatests/test_cmdline/test_ipagetkeytab.py index 7b57ba194..d903305ed 100644 --- a/ipatests/test_cmdline/test_ipagetkeytab.py +++ b/ipatests/test_cmdline/test_ipagetkeytab.py @@ -32,6 +32,7 @@ import tempfile import gssapi from ipaserver.plugins.ldap2 import ldap2 from ipapython.dn import DN +import pytest def use_keytab(principal, keytab): try: @@ -52,6 +53,8 @@ def use_keytab(principal, keytab): if tmpdir: shutil.rmtree(tmpdir) + +@pytest.mark.tier0 class test_ipagetkeytab(cmdline_test): """ Test `ipa-getkeytab`. diff --git a/ipatests/test_install/test_updates.py b/ipatests/test_install/test_updates.py index 9e92aea6c..b41a7c5d2 100644 --- a/ipatests/test_install/test_updates.py +++ b/ipatests/test_install/test_updates.py @@ -24,6 +24,7 @@ import unittest import os import nose +import pytest from ipalib import api from ipalib import errors @@ -45,6 +46,8 @@ have occurred as expected. The DM password needs to be set in ~/.ipa/.dmpw """ + +@pytest.mark.tier0 class test_update(unittest.TestCase): """ Test the LDAP updater. diff --git a/ipatests/test_ipalib/test_aci.py b/ipatests/test_ipalib/test_aci.py index fc484988f..8ced2a93c 100644 --- a/ipatests/test_ipalib/test_aci.py +++ b/ipatests/test_ipalib/test_aci.py @@ -25,6 +25,10 @@ from __future__ import print_function from ipalib.aci import ACI +import pytest + +pytestmark = pytest.mark.tier0 + def check_aci_parsing(source, expected): a = ACI(source) print('ACI was: ', a) diff --git a/ipatests/test_ipalib/test_backend.py b/ipatests/test_ipalib/test_backend.py index 4e014f654..086831037 100644 --- a/ipatests/test_ipalib/test_backend.py +++ b/ipatests/test_ipalib/test_backend.py @@ -34,7 +34,9 @@ from ipalib.frontend import Command from ipalib import backend, plugable, errors, base from ipapython.version import API_VERSION +import pytest +pytestmark = pytest.mark.tier0 class test_Backend(ClassChecker): """ diff --git a/ipatests/test_ipalib/test_base.py b/ipatests/test_ipalib/test_base.py index 9b1b6a778..d69ee67f6 100644 --- a/ipatests/test_ipalib/test_base.py +++ b/ipatests/test_ipalib/test_base.py @@ -22,6 +22,7 @@ Test the `ipalib.base` module. """ import six +import pytest from ipatests.util import ClassChecker, raises from ipalib.constants import NAME_REGEX, NAME_ERROR @@ -32,6 +33,9 @@ if six.PY3: unicode = str +pytestmark = pytest.mark.tier0 + + class test_ReadOnly(ClassChecker): """ Test the `ipalib.base.ReadOnly` class diff --git a/ipatests/test_ipalib/test_capabilities.py b/ipatests/test_ipalib/test_capabilities.py index 21e53c2dc..9a44fbebc 100644 --- a/ipatests/test_ipalib/test_capabilities.py +++ b/ipatests/test_ipalib/test_capabilities.py @@ -23,6 +23,9 @@ Test the `ipalib.errors` module. from ipalib.capabilities import capabilities, client_has_capability +import pytest + +pytestmark = pytest.mark.tier0 def test_client_has_capability(): assert capabilities['messages'] == u'2.52' diff --git a/ipatests/test_ipalib/test_cli.py b/ipatests/test_ipalib/test_cli.py index 0c3affcd3..3004e1f76 100644 --- a/ipatests/test_ipalib/test_cli.py +++ b/ipatests/test_ipalib/test_cli.py @@ -24,6 +24,9 @@ Test the `ipalib.cli` module. from ipatests.util import raises, get_api, ClassChecker from ipalib import cli, plugable, frontend, backend +import pytest + +pytestmark = pytest.mark.tier0 class test_textui(ClassChecker): _cls = cli.textui diff --git a/ipatests/test_ipalib/test_config.py b/ipatests/test_ipalib/test_config.py index 5a0de1e1f..09885a578 100644 --- a/ipatests/test_ipalib/test_config.py +++ b/ipatests/test_ipalib/test_config.py @@ -34,6 +34,9 @@ from ipalib.constants import NAME_REGEX, NAME_ERROR from ipalib import config, constants, base from ipaplatform.paths import paths +import pytest + +pytestmark = pytest.mark.tier0 # Valid environment variables in (key, raw, value) tuples: # key: the name of the environment variable diff --git a/ipatests/test_ipalib/test_crud.py b/ipatests/test_ipalib/test_crud.py index 910da279d..c4b69c556 100644 --- a/ipatests/test_ipalib/test_crud.py +++ b/ipatests/test_ipalib/test_crud.py @@ -25,6 +25,9 @@ from ipatests.util import read_only, raises, get_api, ClassChecker from ipalib import crud, frontend, plugable, config from ipalib.parameters import Str +import pytest + +pytestmark = pytest.mark.tier0 class CrudChecker(ClassChecker): """ diff --git a/ipatests/test_ipalib/test_errors.py b/ipatests/test_ipalib/test_errors.py index 954bfcd9a..4dc84501b 100644 --- a/ipatests/test_ipalib/test_errors.py +++ b/ipatests/test_ipalib/test_errors.py @@ -26,6 +26,7 @@ Test the `ipalib.errors` module. import re import inspect +import pytest import six @@ -38,6 +39,9 @@ if six.PY3: unicode = str +pytestmark = pytest.mark.tier0 + + class PrivateExceptionTester(object): _klass = None __klass = None diff --git a/ipatests/test_ipalib/test_frontend.py b/ipatests/test_ipalib/test_frontend.py index ace6b7eb4..a4af5e43c 100644 --- a/ipatests/test_ipalib/test_frontend.py +++ b/ipatests/test_ipalib/test_frontend.py @@ -23,6 +23,7 @@ Test the `ipalib.frontend` module. # FIXME: Pylint errors # pylint: disable=no-member +import pytest import six @@ -40,6 +41,9 @@ if six.PY3: unicode = str +pytestmark = pytest.mark.tier0 + + def test_RULE_FLAG(): assert frontend.RULE_FLAG == 'validation_rule' diff --git a/ipatests/test_ipalib/test_messages.py b/ipatests/test_ipalib/test_messages.py index 966a6c133..dad0e988a 100644 --- a/ipatests/test_ipalib/test_messages.py +++ b/ipatests/test_ipalib/test_messages.py @@ -25,6 +25,9 @@ from ipalib import messages from ipalib.capabilities import capabilities from ipatests.test_ipalib import test_errors +import pytest + +pytestmark = pytest.mark.tier0 class HelloMessage(messages.PublicMessage): type = 'info' diff --git a/ipatests/test_ipalib/test_output.py b/ipatests/test_ipalib/test_output.py index 1161e649a..927da74f3 100644 --- a/ipatests/test_ipalib/test_output.py +++ b/ipatests/test_ipalib/test_output.py @@ -27,6 +27,10 @@ from ipalib.frontend import Command from ipalib import _ from ipapython.version import API_VERSION +import pytest + +pytestmark = pytest.mark.tier0 + class test_Output(ClassChecker): """ Test the `ipalib.output.Output` class. diff --git a/ipatests/test_ipalib/test_parameters.py b/ipatests/test_ipalib/test_parameters.py index c1ebf900d..b640f50da 100644 --- a/ipatests/test_ipalib/test_parameters.py +++ b/ipatests/test_ipalib/test_parameters.py @@ -31,6 +31,7 @@ import sys from decimal import Decimal from inspect import isclass from six.moves.xmlrpc_client import MAXINT, MININT +import pytest import six @@ -48,6 +49,9 @@ if six.PY3: NULLS = (None, b'', u'', tuple(), []) +pytestmark = pytest.mark.tier0 + + class test_DefaultFrom(ClassChecker): """ Test the `ipalib.parameters.DefaultFrom` class. diff --git a/ipatests/test_ipalib/test_plugable.py b/ipatests/test_ipalib/test_plugable.py index caf08d6b9..3e7e64bc8 100644 --- a/ipatests/test_ipalib/test_plugable.py +++ b/ipatests/test_ipalib/test_plugable.py @@ -31,6 +31,9 @@ from ipatests.util import ClassChecker, create_test_api from ipalib import plugable, errors, text from ipaplatform.paths import paths +import pytest + +pytestmark = pytest.mark.tier0 class test_Plugin(ClassChecker): """ diff --git a/ipatests/test_ipalib/test_text.py b/ipatests/test_ipalib/test_text.py index 195610d27..acf0bc22c 100644 --- a/ipatests/test_ipalib/test_text.py +++ b/ipatests/test_ipalib/test_text.py @@ -30,6 +30,7 @@ import re import nose import locale import six +import pytest from ipatests.util import raises, assert_equal from ipatests.i18n import create_po, po_file_iterate @@ -41,6 +42,8 @@ from ipapython.ipautil import file_exists if six.PY3: unicode = str +pytestmark = pytest.mark.tier0 + singular = '%(count)d goose makes a %(dish)s' plural = '%(count)d geese make a %(dish)s' diff --git a/ipatests/test_ipalib/test_x509.py b/ipatests/test_ipalib/test_x509.py index d8004c4a0..28745ffd8 100644 --- a/ipatests/test_ipalib/test_x509.py +++ b/ipatests/test_ipalib/test_x509.py @@ -29,6 +29,10 @@ from nss.error import NSPRError from ipalib import x509 from ipapython.dn import DN +import pytest + +pytestmark = pytest.mark.tier0 + # certutil - # certificate for CN=ipa.example.com,O=IPA diff --git a/ipatests/test_ipapython/test_cookie.py b/ipatests/test_ipapython/test_cookie.py index b8a2d36da..5b71b0745 100644 --- a/ipatests/test_ipapython/test_cookie.py +++ b/ipatests/test_ipapython/test_cookie.py @@ -24,6 +24,10 @@ import email.utils import calendar from ipapython.cookie import Cookie +import pytest + +pytestmark = pytest.mark.tier0 + class TestParse(unittest.TestCase): def test_parse(self): diff --git a/ipatests/test_ipapython/test_dn.py b/ipatests/test_ipapython/test_dn.py index fe498cc3d..eb763b3a6 100644 --- a/ipatests/test_ipapython/test_dn.py +++ b/ipatests/test_ipapython/test_dn.py @@ -1,5 +1,7 @@ import contextlib import unittest +import pytest +from ipapython.dn import * # FIXME import six @@ -29,6 +31,8 @@ if six.PY3: assert a >= b return 1 +pytestmark = pytest.mark.tier0 + def expected_class(klass, component): if klass is AVA: diff --git a/ipatests/test_ipapython/test_ipap11helper.py b/ipatests/test_ipapython/test_ipap11helper.py index 32e87503d..0b442b553 100644 --- a/ipatests/test_ipapython/test_ipap11helper.py +++ b/ipatests/test_ipapython/test_ipap11helper.py @@ -19,6 +19,7 @@ from ipaplatform.paths import paths import _ipap11helper +pytestmark = pytest.mark.tier0 CONFIG_DATA = """ # SoftHSM v2 configuration file diff --git a/ipatests/test_ipapython/test_ipautil.py b/ipatests/test_ipapython/test_ipautil.py index e19cd2cb6..d574bd809 100644 --- a/ipatests/test_ipapython/test_ipautil.py +++ b/ipatests/test_ipapython/test_ipautil.py @@ -28,6 +28,10 @@ import six from ipapython import ipautil +import pytest + +pytestmark = pytest.mark.tier0 + def make_ipaddress_checker(addr, words=None, prefixlen=None): def check_ipaddress(): diff --git a/ipatests/test_ipapython/test_ipavalidate.py b/ipatests/test_ipapython/test_ipavalidate.py index b912797dd..54a62f664 100644 --- a/ipatests/test_ipapython/test_ipavalidate.py +++ b/ipatests/test_ipapython/test_ipavalidate.py @@ -21,9 +21,12 @@ import sys sys.path.insert(0, ".") import unittest +import pytest from ipapython import ipavalidate +pytestmark = pytest.mark.tier0 + class TestValidate(unittest.TestCase): def test_validEmail(self): self.assertEqual(True, ipavalidate.Email("test@freeipa.org")) diff --git a/ipatests/test_ipapython/test_keyring.py b/ipatests/test_ipapython/test_keyring.py index 0a7f0980c..84b9f0ffa 100644 --- a/ipatests/test_ipapython/test_keyring.py +++ b/ipatests/test_ipapython/test_keyring.py @@ -23,6 +23,10 @@ Test the `kernel_keyring.py` module. from nose.tools import raises, assert_raises # pylint: disable=E0611 from ipapython import kernel_keyring +import pytest + +pytestmark = pytest.mark.tier0 + TEST_KEY = 'ipa_test' TEST_VALUE = 'abc123' UPDATE_VALUE = '123abc' diff --git a/ipatests/test_ipapython/test_ssh.py b/ipatests/test_ipapython/test_ssh.py index 2930ea655..509d1a085 100644 --- a/ipatests/test_ipapython/test_ssh.py +++ b/ipatests/test_ipapython/test_ssh.py @@ -24,12 +24,15 @@ import base64 import six import nose +import pytest from ipapython import ssh if six.PY3: unicode = str +pytestmark = pytest.mark.tier0 + def make_public_key_checker(pk, out): def check_public_key(): diff --git a/ipatests/test_ipaserver/test_changepw.py b/ipatests/test_ipaserver/test_changepw.py index 2a44017d4..866ea5554 100644 --- a/ipatests/test_ipaserver/test_changepw.py +++ b/ipatests/test_ipaserver/test_changepw.py @@ -19,6 +19,7 @@ import nose import ldap +import pytest from ipatests.test_ipaserver.httptest import Unauthorized_HTTP_test from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test @@ -30,6 +31,8 @@ testuser = u'tuser' old_password = u'old_password' new_password = u'new_password' + +@pytest.mark.tier1 class test_changepw(XMLRPC_test, Unauthorized_HTTP_test): app_uri = '/ipa/session/change_password' diff --git a/ipatests/test_ipaserver/test_install/test_adtrustinstance.py b/ipatests/test_ipaserver/test_install/test_adtrustinstance.py index 75e53f35e..6a050c80e 100755 --- a/ipatests/test_ipaserver/test_install/test_adtrustinstance.py +++ b/ipatests/test_ipaserver/test_install/test_adtrustinstance.py @@ -24,12 +24,15 @@ import os import six import nose +import pytest from ipaserver.install import adtrustinstance if six.PY3: unicode = str + +@pytest.mark.tier0 class test_adtrustinstance: """ Test `adtrustinstance`. diff --git a/ipatests/test_ipaserver/test_install/test_service.py b/ipatests/test_ipaserver/test_install/test_service.py index 956ae6256..71519d7d1 100644 --- a/ipatests/test_ipaserver/test_install/test_service.py +++ b/ipatests/test_ipaserver/test_install/test_service.py @@ -22,8 +22,10 @@ Tests for the `ipaserver.service` module. """ from ipaserver.install import service +import pytest +@pytest.mark.tier0 def test_format_seconds(): assert service.format_seconds(0) == '0 seconds' assert service.format_seconds(1) == '1 second' diff --git a/ipatests/test_ipaserver/test_ldap.py b/ipatests/test_ipaserver/test_ldap.py index 47d37c9bf..13186a6fd 100644 --- a/ipatests/test_ipaserver/test_ldap.py +++ b/ipatests/test_ipaserver/test_ldap.py @@ -45,6 +45,8 @@ from ipapython.dn import DN if six.PY3: unicode = str + +@pytest.mark.tier0 class test_ldap(object): """ Test various LDAP client bind methods. @@ -155,6 +157,7 @@ class test_ldap(object): assert serial is not None +@pytest.mark.tier0 class test_LDAPEntry(object): """ Test the LDAPEntry class diff --git a/ipatests/test_ipaserver/test_otptoken_import.py b/ipatests/test_ipaserver/test_otptoken_import.py index 798f721f5..3325b0c5a 100644 --- a/ipatests/test_ipaserver/test_otptoken_import.py +++ b/ipatests/test_ipaserver/test_otptoken_import.py @@ -29,6 +29,7 @@ from ipaserver.install.ipa_otptoken_import import PSKCDocument, ValidationError basename = os.path.join(os.path.dirname(__file__), "data") @pytest.mark.skipif(True, reason="Causes NSS errors. Ticket 5192") +@pytest.mark.tier1 class test_otptoken_import(object): def teardown(self): diff --git a/ipatests/test_ipaserver/test_rpcserver.py b/ipatests/test_ipaserver/test_rpcserver.py index ce5a03a13..976ebf7d6 100644 --- a/ipatests/test_ipaserver/test_rpcserver.py +++ b/ipatests/test_ipaserver/test_rpcserver.py @@ -22,6 +22,7 @@ Test the `ipaserver.rpc` module. """ import json +import pytest import six @@ -33,6 +34,7 @@ from ipaserver import rpcserver if six.PY3: unicode = str +pytestmark = pytest.mark.tier0 class StartResponse(object): def __init__(self): diff --git a/ipatests/test_ipaserver/test_topology_plugin.py b/ipatests/test_ipaserver/test_topology_plugin.py index b162822e0..6407f3e6f 100644 --- a/ipatests/test_ipaserver/test_topology_plugin.py +++ b/ipatests/test_ipaserver/test_topology_plugin.py @@ -11,6 +11,7 @@ from ipapython.dn import DN import pytest +@pytest.mark.tier1 class TestTopologyPlugin(object): """ Test Topology plugin from the DS point of view diff --git a/ipatests/test_pkcs10/test_pkcs10.py b/ipatests/test_pkcs10/test_pkcs10.py index a36d1883e..86de3c696 100644 --- a/ipatests/test_pkcs10/test_pkcs10.py +++ b/ipatests/test_pkcs10/test_pkcs10.py @@ -30,7 +30,10 @@ from ipalib import pkcs10 from ipapython import ipautil import nss.nss as nss from nss.error import NSPRError +import pytest + +@pytest.mark.tier0 class test_update(object): """ Test the PKCS#10 Parser. diff --git a/ipatests/test_util.py b/ipatests/test_util.py index aeb3c93ef..5d3328015 100644 --- a/ipatests/test_util.py +++ b/ipatests/test_util.py @@ -27,10 +27,13 @@ import six from ipatests import util from ipatests.util import raises, TYPE, VALUE, LEN, KEYS +import pytest if six.PY3: unicode = str +pytestmark = pytest.mark.tier0 + class Prop(object): def __init__(self, *ops): diff --git a/ipatests/test_webui/test_automember.py b/ipatests/test_webui/test_automember.py index 0378812cc..8d07c8c99 100644 --- a/ipatests/test_webui/test_automember.py +++ b/ipatests/test_webui/test_automember.py @@ -25,6 +25,7 @@ from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot import ipatests.test_webui.data_hostgroup as hostgroup from ipatests.test_webui.test_host import host_tasks +import pytest ENTITY = 'automember' @@ -50,6 +51,7 @@ HOST_GROUP_DATA = { } +@pytest.mark.tier1 class test_automember(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_automount.py b/ipatests/test_webui/test_automount.py index 8a748abe4..9bb64ccf4 100644 --- a/ipatests/test_webui/test_automount.py +++ b/ipatests/test_webui/test_automount.py @@ -23,6 +23,7 @@ Automount tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot +import pytest LOC_ENTITY = 'automountlocation' MAP_ENTITY = 'automountmap' @@ -61,6 +62,7 @@ KEY_DATA = { } +@pytest.mark.tier1 class test_automount(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_cert.py b/ipatests/test_webui/test_cert.py index ec704eb11..c1a3461ad 100644 --- a/ipatests/test_webui/test_cert.py +++ b/ipatests/test_webui/test_cert.py @@ -23,10 +23,12 @@ Cert tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot +import pytest ENTITY = 'cert' +@pytest.mark.tier1 class test_cert(UI_driver): def setup(self, *args, **kwargs): diff --git a/ipatests/test_webui/test_config.py b/ipatests/test_webui/test_config.py index edeec10db..b64e90f14 100644 --- a/ipatests/test_webui/test_config.py +++ b/ipatests/test_webui/test_config.py @@ -23,6 +23,7 @@ Config tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot +import pytest ENTITY = 'config' @@ -41,6 +42,7 @@ DATA2 = { } +@pytest.mark.tier1 class test_config(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_delegation.py b/ipatests/test_webui/test_delegation.py index a3e70609f..5c2b380d3 100644 --- a/ipatests/test_webui/test_delegation.py +++ b/ipatests/test_webui/test_delegation.py @@ -23,6 +23,7 @@ Delegation tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot +import pytest ENTITY = 'delegation' PKEY = 'itest-delegation-rule' @@ -42,6 +43,7 @@ DATA = { } +@pytest.mark.tier1 class test_delegation(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_dns.py b/ipatests/test_webui/test_dns.py index 4ad15bd6d..a576db9df 100644 --- a/ipatests/test_webui/test_dns.py +++ b/ipatests/test_webui/test_dns.py @@ -23,6 +23,7 @@ DNS tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot +import pytest ZONE_ENTITY = 'dnszone' FORWARD_ZONE_ENTITY = 'dnsforwardzone' @@ -85,6 +86,7 @@ CONFIG_MOD_DATA = { } +@pytest.mark.tier1 class test_dns(UI_driver): def setup(self, *args, **kwargs): diff --git a/ipatests/test_webui/test_group.py b/ipatests/test_webui/test_group.py index 06b34d089..91ae2d23e 100644 --- a/ipatests/test_webui/test_group.py +++ b/ipatests/test_webui/test_group.py @@ -29,8 +29,10 @@ import ipatests.test_webui.data_netgroup as netgroup import ipatests.test_webui.data_hbac as hbac import ipatests.test_webui.test_rbac as rbac import ipatests.test_webui.data_sudo as sudo +import pytest +@pytest.mark.tier1 class test_group(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_hbac.py b/ipatests/test_webui/test_hbac.py index c497a2acb..d8e9f9ecf 100644 --- a/ipatests/test_webui/test_hbac.py +++ b/ipatests/test_webui/test_hbac.py @@ -25,8 +25,10 @@ from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot import ipatests.test_webui.data_hbac as hbac import ipatests.test_webui.data_hostgroup as hostgroup +import pytest +@pytest.mark.tier1 class test_hbac(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_host.py b/ipatests/test_webui/test_host.py index 368148428..7ee6b4bac 100644 --- a/ipatests/test_webui/test_host.py +++ b/ipatests/test_webui/test_host.py @@ -28,10 +28,12 @@ import ipatests.test_webui.data_netgroup as netgroup import ipatests.test_webui.data_hbac as hbac import ipatests.test_webui.test_rbac as rbac import ipatests.test_webui.data_sudo as sudo +import pytest ENTITY = 'host' +@pytest.mark.tier1 class host_tasks(UI_driver): def setup(self, *args, **kwargs): @@ -103,6 +105,7 @@ class host_tasks(UI_driver): return csr +@pytest.mark.tier1 class test_host(host_tasks): @screenshot diff --git a/ipatests/test_webui/test_hostgroup.py b/ipatests/test_webui/test_hostgroup.py index e2dbbf588..1879bad8c 100644 --- a/ipatests/test_webui/test_hostgroup.py +++ b/ipatests/test_webui/test_hostgroup.py @@ -29,8 +29,10 @@ import ipatests.test_webui.data_netgroup as netgroup import ipatests.test_webui.data_hbac as hbac import ipatests.test_webui.test_rbac as rbac import ipatests.test_webui.data_sudo as sudo +import pytest +@pytest.mark.tier1 class test_hostgroup(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_krbtpolicy.py b/ipatests/test_webui/test_krbtpolicy.py index 0b9252efc..2bfb96482 100644 --- a/ipatests/test_webui/test_krbtpolicy.py +++ b/ipatests/test_webui/test_krbtpolicy.py @@ -23,6 +23,7 @@ Kerberos policy tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot +import pytest ENTITY = 'krbtpolicy' @@ -41,6 +42,7 @@ DATA2 = { } +@pytest.mark.tier1 class test_krbtpolicy(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_navigation.py b/ipatests/test_webui/test_navigation.py index 530a757ad..b5dc928ac 100644 --- a/ipatests/test_webui/test_navigation.py +++ b/ipatests/test_webui/test_navigation.py @@ -23,6 +23,7 @@ Basic ui tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot +import pytest ENTITIES = [ @@ -65,6 +66,7 @@ ENTITIES = [ ] +@pytest.mark.tier1 class test_navigation(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_netgroup.py b/ipatests/test_webui/test_netgroup.py index 3dfea0dfa..05036366e 100644 --- a/ipatests/test_webui/test_netgroup.py +++ b/ipatests/test_webui/test_netgroup.py @@ -28,8 +28,10 @@ import ipatests.test_webui.data_user as user import ipatests.test_webui.data_group as group import ipatests.test_webui.data_hostgroup as hostgroup from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY +import pytest +@pytest.mark.tier1 class test_netgroup(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_pwpolicy.py b/ipatests/test_webui/test_pwpolicy.py index 7abdfd667..91dee21dc 100644 --- a/ipatests/test_webui/test_pwpolicy.py +++ b/ipatests/test_webui/test_pwpolicy.py @@ -23,6 +23,7 @@ Password policy tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot +import pytest ENTITY = 'pwpolicy' DATA = { @@ -44,6 +45,7 @@ DATA = { } +@pytest.mark.tier1 class test_pwpolicy(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_range.py b/ipatests/test_webui/test_range.py index e1c46e50a..35d2d60d9 100644 --- a/ipatests/test_webui/test_range.py +++ b/ipatests/test_webui/test_range.py @@ -24,11 +24,13 @@ Range tests import ipatests.test_webui.test_trust as trust_mod from ipatests.test_webui.ui_driver import screenshot from ipatests.test_webui.task_range import range_tasks +import pytest ENTITY = 'idrange' PKEY = 'itest-range' +@pytest.mark.tier1 class test_range(range_tasks): @screenshot diff --git a/ipatests/test_webui/test_rbac.py b/ipatests/test_webui/test_rbac.py index 07cc28826..0f819ddc4 100644 --- a/ipatests/test_webui/test_rbac.py +++ b/ipatests/test_webui/test_rbac.py @@ -23,6 +23,7 @@ RBAC tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot +import pytest ROLE_ENTITY = 'role' ROLE_DEF_FACET = 'member_user' @@ -70,6 +71,7 @@ PERMISSION_DATA = { } +@pytest.mark.tier1 class test_rbac(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_realmdomains.py b/ipatests/test_webui/test_realmdomains.py index 87af690c7..e7737c932 100644 --- a/ipatests/test_webui/test_realmdomains.py +++ b/ipatests/test_webui/test_realmdomains.py @@ -23,10 +23,12 @@ Realm domains tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot +import pytest ENTITY = 'realmdomains' +@pytest.mark.tier1 class test_realmdomains(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_selfservice.py b/ipatests/test_webui/test_selfservice.py index 15fd23d4e..e7c031b33 100644 --- a/ipatests/test_webui/test_selfservice.py +++ b/ipatests/test_webui/test_selfservice.py @@ -23,6 +23,7 @@ Selfservice tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot +import pytest ENTITY = 'selfservice' PKEY = 'itest-selfservice-rule' @@ -39,6 +40,7 @@ DATA = { } +@pytest.mark.tier1 class test_selfservice(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_selinuxusermap.py b/ipatests/test_webui/test_selinuxusermap.py index 65f7f33dd..77216891d 100644 --- a/ipatests/test_webui/test_selinuxusermap.py +++ b/ipatests/test_webui/test_selinuxusermap.py @@ -27,6 +27,7 @@ import ipatests.test_webui.data_user as user import ipatests.test_webui.data_group as group import ipatests.test_webui.data_hostgroup as hostgroup from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY +import pytest ENTITY = 'selinuxusermap' PKEY = 'itest-selinuxusermap' @@ -42,6 +43,7 @@ DATA = { } +@pytest.mark.tier1 class test_selinuxusermap(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_service.py b/ipatests/test_webui/test_service.py index c882a1cad..f582b688c 100644 --- a/ipatests/test_webui/test_service.py +++ b/ipatests/test_webui/test_service.py @@ -23,10 +23,12 @@ Service tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot +import pytest ENTITY = 'service' +@pytest.mark.tier1 class sevice_tasks(UI_driver): def prep_data(self): @@ -59,6 +61,7 @@ class sevice_tasks(UI_driver): return pkey +@pytest.mark.tier1 class test_service(sevice_tasks): @screenshot diff --git a/ipatests/test_webui/test_sudo.py b/ipatests/test_webui/test_sudo.py index ab484a09e..eb6430fd0 100644 --- a/ipatests/test_webui/test_sudo.py +++ b/ipatests/test_webui/test_sudo.py @@ -29,8 +29,10 @@ import ipatests.test_webui.data_user as user import ipatests.test_webui.data_group as group import ipatests.test_webui.data_hostgroup as hostgroup from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY +import pytest +@pytest.mark.tier1 class test_sudo(UI_driver): @screenshot diff --git a/ipatests/test_webui/test_trust.py b/ipatests/test_webui/test_trust.py index 138eabf2e..621b2d477 100644 --- a/ipatests/test_webui/test_trust.py +++ b/ipatests/test_webui/test_trust.py @@ -24,6 +24,7 @@ Trust tests from ipatests.test_webui.ui_driver import UI_driver from ipatests.test_webui.ui_driver import screenshot from ipatests.test_webui.task_range import range_tasks +import pytest ENTITY = 'trust' CONFIG_ENTITY = 'trustconfig' @@ -41,6 +42,7 @@ CONFIG_DATA2 = { } +@pytest.mark.tier1 class trust_tasks(UI_driver): def get_data(self, add_data=None): @@ -93,6 +95,7 @@ class trust_tasks(UI_driver): return domain.upper() + '_id_range' +@pytest.mark.tier1 class test_trust(trust_tasks): def setup(self, *args, **kwargs): diff --git a/ipatests/test_webui/test_user.py b/ipatests/test_webui/test_user.py index d7087b906..b216125b2 100644 --- a/ipatests/test_webui/test_user.py +++ b/ipatests/test_webui/test_user.py @@ -29,6 +29,7 @@ import ipatests.test_webui.data_netgroup as netgroup import ipatests.test_webui.data_hbac as hbac import ipatests.test_webui.test_rbac as rbac import ipatests.test_webui.data_sudo as sudo +import pytest try: from selenium.webdriver.common.by import By @@ -36,6 +37,7 @@ except ImportError: pass +@pytest.mark.tier1 class test_user(UI_driver): @screenshot diff --git a/ipatests/test_xmlrpc/test_add_remove_cert_cmd.py b/ipatests/test_xmlrpc/test_add_remove_cert_cmd.py index c0669c093..122921d79 100644 --- a/ipatests/test_xmlrpc/test_add_remove_cert_cmd.py +++ b/ipatests/test_xmlrpc/test_add_remove_cert_cmd.py @@ -10,8 +10,10 @@ from ipatests.util import assert_deepequal, raises from xmlrpc_test import XMLRPC_test from ipapython.dn import DN from testcert import get_testcert +import pytest +@pytest.mark.tier1 class CertManipCmdTestBase(XMLRPC_test): entity_class = '' entity_pkey = None @@ -270,6 +272,7 @@ class CertManipCmdTestBase(XMLRPC_test): ) +@pytest.mark.tier1 class TestCertManipCmdUser(CertManipCmdTestBase): entity_class = 'user' entity_pkey = u'tuser' @@ -299,6 +302,7 @@ class TestCertManipCmdUser(CertManipCmdTestBase): cls.default_caacl, **cls.cmd_options['caacl']) +@pytest.mark.tier1 class TestCertManipCmdHost(CertManipCmdTestBase): entity_class = 'host' entity_pkey = u'host.example.com' @@ -317,6 +321,7 @@ class TestCertManipCmdHost(CertManipCmdTestBase): cert_del_summary = u'Removed certificates from host "%s"' +@pytest.mark.tier1 class TestCertManipCmdService(CertManipCmdTestBase): entity_class = 'service' entity_pkey = u'testservice/%s@%s' % (TestCertManipCmdHost.entity_pkey, diff --git a/ipatests/test_xmlrpc/test_attr.py b/ipatests/test_xmlrpc/test_attr.py index d04999a99..9248ce044 100644 --- a/ipatests/test_xmlrpc/test_attr.py +++ b/ipatests/test_xmlrpc/test_attr.py @@ -24,9 +24,12 @@ Test --setattr and --addattr and other attribute-specific issues from ipalib import errors from ipatests.test_xmlrpc.xmlrpc_test import Declarative from ipatests.test_xmlrpc.test_user_plugin import get_user_result +import pytest user1=u'tuser1' + +@pytest.mark.tier1 class test_attr(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_automember_plugin.py b/ipatests/test_xmlrpc/test_automember_plugin.py index 760964dc0..be0f73905 100644 --- a/ipatests/test_xmlrpc/test_automember_plugin.py +++ b/ipatests/test_xmlrpc/test_automember_plugin.py @@ -29,6 +29,7 @@ from ipatests.test_xmlrpc.xmlrpc_test import ( fuzzy_automember_message) from ipatests.test_xmlrpc.test_user_plugin import get_user_result +import pytest user1 = u'tuser1' user_does_not_exist = u'does_not_exist' @@ -66,6 +67,7 @@ hostgroup_exclude_regex2 = u'^www5' hostgroup_exclude_regex3 = u'^webserver5' +@pytest.mark.tier1 class test_automember(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_automount_plugin.py b/ipatests/test_xmlrpc/test_automount_plugin.py index dcc79c83c..073dfcf14 100644 --- a/ipatests/test_xmlrpc/test_automount_plugin.py +++ b/ipatests/test_xmlrpc/test_automount_plugin.py @@ -25,6 +25,7 @@ import sys import textwrap import tempfile import shutil +import pytest from ipalib import api from ipalib import errors @@ -115,6 +116,8 @@ class AutomountTest(XMLRPC_test): # Success; delete the temporary directory shutil.rmtree(conf_directory) + +@pytest.mark.tier1 class test_automount(AutomountTest): """ Test the `automount` plugin. @@ -323,6 +326,7 @@ class test_automount(AutomountTest): api.Command['automountkey_show'](self.locname, self.mapname, **key_kw) +@pytest.mark.tier1 class test_automount_direct(AutomountTest): """ Test the `automount` plugin indirect map functionality. @@ -388,6 +392,7 @@ class test_automount_direct(AutomountTest): self.check_import_roundtrip() +@pytest.mark.tier1 class test_automount_indirect(AutomountTest): """ Test the `automount` plugin indirect map functionality. @@ -486,6 +491,8 @@ class test_automount_indirect(AutomountTest): """ self.check_import_roundtrip() + +@pytest.mark.tier1 class test_automount_indirect_no_parent(AutomountTest): """ Test the `automount` plugin Indirect map function. diff --git a/ipatests/test_xmlrpc/test_baseldap_plugin.py b/ipatests/test_xmlrpc/test_baseldap_plugin.py index 477772c00..6764b1051 100644 --- a/ipatests/test_xmlrpc/test_baseldap_plugin.py +++ b/ipatests/test_xmlrpc/test_baseldap_plugin.py @@ -28,8 +28,10 @@ from ipapython import ipaldap from ipalib import errors from ipalib.plugins import baseldap from ipatests.util import assert_deepequal +import pytest +@pytest.mark.tier0 def test_exc_wrapper(): """Test the CallbackInterface._exc_wrapper helper method""" handled_exceptions = [] @@ -73,6 +75,7 @@ def test_exc_wrapper(): assert handled_exceptions == [None, errors.ExecutionError] +@pytest.mark.tier0 def test_callback_registration(): class callbacktest_base(baseldap.CallbackInterface): _callback_registry = dict(test={}) @@ -117,6 +120,7 @@ def test_callback_registration(): ('Subclass registered callback', 42)] +@pytest.mark.tier0 def test_exc_callback_registration(): messages = [] class callbacktest_base(baseldap.BaseLDAPCommand): @@ -169,6 +173,7 @@ def test_exc_callback_registration(): assert messages == ['Base exc_callback', 'Subclass registered callback'] +@pytest.mark.tier0 def test_entry_to_dict(): class FakeAttributeType(object): def __init__(self, name, syntax): diff --git a/ipatests/test_xmlrpc/test_batch_plugin.py b/ipatests/test_xmlrpc/test_batch_plugin.py index 1cfeb53bb..ca042d347 100644 --- a/ipatests/test_xmlrpc/test_batch_plugin.py +++ b/ipatests/test_xmlrpc/test_batch_plugin.py @@ -27,6 +27,7 @@ from ipatests.util import assert_equal, Fuzzy, assert_deepequal from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits, fuzzy_uuid) from ipapython.dn import DN +import pytest group1 = u'testgroup1' first1 = u'John' @@ -48,6 +49,7 @@ def deepequal_list(*expected): return checker +@pytest.mark.tier1 class test_batch(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_caacl_plugin.py b/ipatests/test_xmlrpc/test_caacl_plugin.py index 33268d6dd..8b156a65a 100644 --- a/ipatests/test_xmlrpc/test_caacl_plugin.py +++ b/ipatests/test_xmlrpc/test_caacl_plugin.py @@ -414,11 +414,13 @@ def staged_user(request): return tracker.make_fixture(request) +@pytest.mark.tier0 class TestDefaultACL(XMLRPC_test): def test_default_acl_present(self, default_acl): default_acl.retrieve() +@pytest.mark.tier1 class TestCAACLbasicCRUD(XMLRPC_test): def test_create(self, crud_acl): crud_acl.create() @@ -447,6 +449,7 @@ class TestCAACLbasicCRUD(XMLRPC_test): crud_acl.find() +@pytest.mark.tier1 class TestCAACLMembers(XMLRPC_test): def test_category_member_exclusivity(self, category_acl, default_profile): category_acl.create() diff --git a/ipatests/test_xmlrpc/test_caacl_profile_enforcement.py b/ipatests/test_xmlrpc/test_caacl_profile_enforcement.py index e9472b078..78262ae8c 100644 --- a/ipatests/test_xmlrpc/test_caacl_profile_enforcement.py +++ b/ipatests/test_xmlrpc/test_caacl_profile_enforcement.py @@ -100,6 +100,7 @@ def smime_group(request): return u'smime_users' +@pytest.mark.tier1 class TestCertSignMIME(XMLRPC_test): def test_cert_import(self, smime_profile): @@ -125,6 +126,7 @@ class TestCertSignMIME(XMLRPC_test): profile_id=smime_profile.name) +@pytest.mark.tier1 class TestSignWithDisabledACL(XMLRPC_test): def test_import_profile_and_acl(self, smime_profile, smime_acl): @@ -162,6 +164,7 @@ class TestSignWithDisabledACL(XMLRPC_test): principal=smime_user) +@pytest.mark.tier1 class TestSignWithoutGroupMembership(XMLRPC_test): def test_import_profile_and_acl(self, smime_profile, smime_acl): @@ -197,6 +200,7 @@ class TestSignWithoutGroupMembership(XMLRPC_test): principal=smime_user) +@pytest.mark.tier1 class TestSignWithChangedProfile(XMLRPC_test): """ Test to verify that the updated profile is used. diff --git a/ipatests/test_xmlrpc/test_cert_plugin.py b/ipatests/test_xmlrpc/test_cert_plugin.py index a593db7f9..f54a226e4 100644 --- a/ipatests/test_xmlrpc/test_cert_plugin.py +++ b/ipatests/test_xmlrpc/test_cert_plugin.py @@ -36,6 +36,7 @@ import nose import base64 from ipaplatform.paths import paths from ipapython.dn import DN +import pytest if six.PY3: unicode = str @@ -71,6 +72,8 @@ def is_db_configured(): # The API tested depends on the value of ~/.ipa/default/ra_plugin when # running as the lite-server. + +@pytest.mark.tier1 class test_cert(XMLRPC_test): @classmethod @@ -203,6 +206,8 @@ class test_cert(XMLRPC_test): res = api.Command['service_find'](self.service_princ) assert res['count'] == 0 + +@pytest.mark.tier1 class test_cert_find(XMLRPC_test): @classmethod diff --git a/ipatests/test_xmlrpc/test_certprofile_plugin.py b/ipatests/test_xmlrpc/test_certprofile_plugin.py index 2875cfe11..1f06f99f5 100644 --- a/ipatests/test_xmlrpc/test_certprofile_plugin.py +++ b/ipatests/test_xmlrpc/test_certprofile_plugin.py @@ -221,6 +221,7 @@ def xmlprofile(request): return tracker +@pytest.mark.tier0 class TestDefaultProfile(XMLRPC_test): def test_default_profile_present(self, default_profile): default_profile.retrieve() @@ -243,6 +244,7 @@ class TestDefaultProfile(XMLRPC_test): command() +@pytest.mark.tier1 class TestProfileCRUD(XMLRPC_test): def test_create_duplicate(self, user_profile): msg = u'Certificate Profile with name "{}" already exists' @@ -329,12 +331,14 @@ class TestProfileCRUD(XMLRPC_test): command() +@pytest.mark.tier1 class TestMalformedProfile(XMLRPC_test): def test_malformed_import(self, malformed): with pytest.raises(errors.ExecutionError): malformed.create() +@pytest.mark.tier1 class TestImportFromXML(XMLRPC_test): def test_import_xml(self, xmlprofile): with pytest.raises(errors.ExecutionError): diff --git a/ipatests/test_xmlrpc/test_config_plugin.py b/ipatests/test_xmlrpc/test_config_plugin.py index ec31f1305..291b86a7e 100644 --- a/ipatests/test_xmlrpc/test_config_plugin.py +++ b/ipatests/test_xmlrpc/test_config_plugin.py @@ -24,7 +24,10 @@ Test the `ipalib/plugins/config.py` module. from ipalib import errors from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits, fuzzy_uuid) +import pytest + +@pytest.mark.tier1 class test_config(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_delegation_plugin.py b/ipatests/test_xmlrpc/test_delegation_plugin.py index 3ce7bafb4..119822983 100644 --- a/ipatests/test_xmlrpc/test_delegation_plugin.py +++ b/ipatests/test_xmlrpc/test_delegation_plugin.py @@ -26,10 +26,13 @@ from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits, fuzzy_uuid) from ipapython.dn import DN +import pytest delegation1 = u'testdelegation' member1 = u'admins' + +@pytest.mark.tier1 class test_delegation(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_dns_plugin.py b/ipatests/test_xmlrpc/test_dns_plugin.py index e5d1374d0..4d3117f17 100644 --- a/ipatests/test_xmlrpc/test_dns_plugin.py +++ b/ipatests/test_xmlrpc/test_dns_plugin.py @@ -28,6 +28,7 @@ from ipapython.dn import DN from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits, fuzzy_uuid) +import pytest try: from ipaserver.plugins.ldap2 import ldap2 @@ -420,6 +421,7 @@ if have_ldap2: get_nameservers_error = "No DNS servers found in LDAP" +@pytest.mark.tier1 class test_dns(Declarative): @classmethod @@ -3090,6 +3092,7 @@ class test_dns(Declarative): ] +@pytest.mark.tier1 class test_root_zone(Declarative): @classmethod @@ -3170,6 +3173,7 @@ class test_root_zone(Declarative): ] +@pytest.mark.tier1 class test_forward_zones(Declarative): # https://fedorahosted.org/freeipa/ticket/4750 @@ -4374,6 +4378,7 @@ class test_forward_zones(Declarative): ] +@pytest.mark.tier1 class test_forward_master_zones_mutual_exlusion(Declarative): # https://fedorahosted.org/freeipa/ticket/4750 @@ -4749,6 +4754,7 @@ class test_forward_master_zones_mutual_exlusion(Declarative): ] +@pytest.mark.tier1 class test_forwardzone_delegation_warnings(Declarative): @classmethod @@ -5204,6 +5210,7 @@ class test_forwardzone_delegation_warnings(Declarative): # https://fedorahosted.org/freeipa/ticket/4746 # http://www.freeipa.org/page/V4/DNS:_Automatic_Zone_NS/SOA_Record_Maintenance +@pytest.mark.tier1 class test_dns_soa(Declarative): @classmethod diff --git a/ipatests/test_xmlrpc/test_dns_realmdomains_integration.py b/ipatests/test_xmlrpc/test_dns_realmdomains_integration.py index 76d4a600b..f284e1317 100644 --- a/ipatests/test_xmlrpc/test_dns_realmdomains_integration.py +++ b/ipatests/test_xmlrpc/test_dns_realmdomains_integration.py @@ -30,6 +30,7 @@ from ipapython.dn import DN from ipapython.dnsutil import DNSName from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import Declarative, fuzzy_digits +import pytest if six.PY3: unicode = str @@ -88,6 +89,7 @@ def assert_realmdomain_and_txt_record_not_present(response): return True +@pytest.mark.tier1 class test_dns_realmdomains_integration(Declarative): cleanup_commands = [ ('realmdomains_mod', [], {'associateddomain': [our_domain]}), diff --git a/ipatests/test_xmlrpc/test_external_members.py b/ipatests/test_xmlrpc/test_external_members.py index d78ee216b..8e9d38729 100644 --- a/ipatests/test_xmlrpc/test_external_members.py +++ b/ipatests/test_xmlrpc/test_external_members.py @@ -27,6 +27,7 @@ from ipapython.dn import DN from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_uuid, fuzzy_user_or_group_sid) +import pytest group_name = u'external_group' group_desc = u'Test external group' @@ -42,6 +43,7 @@ def get_trusted_group_name(): return u'%s\Domain Admins' % ad_netbios +@pytest.mark.tier1 class test_external_members(Declarative): @classmethod def setup_class(cls): diff --git a/ipatests/test_xmlrpc/test_group_plugin.py b/ipatests/test_xmlrpc/test_group_plugin.py index d668b399e..ed38c696e 100644 --- a/ipatests/test_xmlrpc/test_group_plugin.py +++ b/ipatests/test_xmlrpc/test_group_plugin.py @@ -53,6 +53,8 @@ external_sid1=u'S-1-1-123456-789-1' def get_group_dn(cn): return DN(('cn', cn), api.env.container_group, api.env.basedn) + +@pytest.mark.tier1 class test_group(Declarative): cleanup_commands = [ ('group_del', [group1], {}), @@ -1019,6 +1021,8 @@ class test_group(Declarative): ), ] + +@pytest.mark.tier1 class test_group_remove_group_from_protected_group(Declarative): cleanup_commands = [ ('group_del', [group1], {}), @@ -1087,6 +1091,8 @@ class test_group_remove_group_from_protected_group(Declarative): ), ] + +@pytest.mark.tier1 class test_group_full_set_of_objectclass_not_available_post_detach(Declarative): # https://fedorahosted.org/freeipa/ticket/4909#comment:1 cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_hbac_plugin.py b/ipatests/test_xmlrpc/test_hbac_plugin.py index a9677bfde..5412591d2 100644 --- a/ipatests/test_xmlrpc/test_hbac_plugin.py +++ b/ipatests/test_xmlrpc/test_hbac_plugin.py @@ -25,7 +25,10 @@ from nose.tools import raises, assert_raises # pylint: disable=E0611 from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test, assert_attr_equal from ipalib import api from ipalib import errors +import pytest + +@pytest.mark.tier1 class test_hbac(XMLRPC_test): """ Test the `hbacrule` plugin. diff --git a/ipatests/test_xmlrpc/test_hbacsvcgroup_plugin.py b/ipatests/test_xmlrpc/test_hbacsvcgroup_plugin.py index 3aaaa36fb..182a76bf9 100644 --- a/ipatests/test_xmlrpc/test_hbacsvcgroup_plugin.py +++ b/ipatests/test_xmlrpc/test_hbacsvcgroup_plugin.py @@ -25,6 +25,7 @@ from ipalib import api, errors from ipatests.test_xmlrpc.xmlrpc_test import Declarative, fuzzy_uuid from ipatests.test_xmlrpc import objectclasses from ipapython.dn import DN +import pytest hbacsvcgroup1 = u'testhbacsvcgroup1' dn1 = DN(('cn',hbacsvcgroup1),('cn','hbacservicegroups'),('cn','hbac'), @@ -35,6 +36,7 @@ hbacsvc_dn1 = DN(('cn',hbacsvc1),('cn','hbacservices'),('cn','hbac'), api.env.basedn) +@pytest.mark.tier1 class test_hbacsvcgroup(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_hbactest_plugin.py b/ipatests/test_xmlrpc/test_hbactest_plugin.py index fc6a4118f..9b631a4b5 100644 --- a/ipatests/test_xmlrpc/test_hbactest_plugin.py +++ b/ipatests/test_xmlrpc/test_hbactest_plugin.py @@ -25,12 +25,16 @@ from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test, assert_attr_equal from ipalib import api from ipalib import errors from nose.tools import raises +import pytest # Test strategy: # 1. Create few allow rules: with user categories, with explicit users, with user groups, with groups, with services # 2. Create users for test # 3. Run detailed and non-detailed tests for explicitly specified rules, check expected result # + + +@pytest.mark.tier1 class test_hbactest(XMLRPC_test): """ Test the `hbactest` plugin. diff --git a/ipatests/test_xmlrpc/test_host_plugin.py b/ipatests/test_xmlrpc/test_host_plugin.py index bba86492e..868c09ce8 100644 --- a/ipatests/test_xmlrpc/test_host_plugin.py +++ b/ipatests/test_xmlrpc/test_host_plugin.py @@ -318,6 +318,7 @@ def ipv6_fromip_host(request): return tracker.make_fixture(request) +@pytest.mark.tier1 class TestNonexistentHost(XMLRPC_test): def test_retrieve_nonexistent(self, host): host.ensure_missing() @@ -341,6 +342,7 @@ class TestNonexistentHost(XMLRPC_test): command() +@pytest.mark.tier1 class TestCRUD(XMLRPC_test): def test_create_duplicate(self, host): host.ensure_exists() @@ -461,6 +463,7 @@ class TestCRUD(XMLRPC_test): host.check_create(result) +@pytest.mark.tier1 class TestMultipleMatches(XMLRPC_test): def test_try_show_multiple_matches_with_shortname(self, host, lab_host): host.ensure_exists() @@ -471,6 +474,7 @@ class TestMultipleMatches(XMLRPC_test): command() +@pytest.mark.tier1 class TestHostWithService(XMLRPC_test): """Test deletion using a non-fully-qualified hostname. Services associated with this host should also be removed. @@ -516,6 +520,7 @@ class TestHostWithService(XMLRPC_test): pass +@pytest.mark.tier1 class TestManagedHosts(XMLRPC_test): def test_managed_hosts(self, host, host2, host3): host.ensure_exists() @@ -580,6 +585,7 @@ class TestManagedHosts(XMLRPC_test): ), result) +@pytest.mark.tier1 class TestProtectedMaster(XMLRPC_test): def test_try_delete_master(self, this_host): command = this_host.make_delete_command() @@ -596,6 +602,7 @@ class TestProtectedMaster(XMLRPC_test): command() +@pytest.mark.tier1 class TestValidation(XMLRPC_test): def test_try_validate_create(self, invalid_host): command = invalid_host.make_create_command() @@ -647,6 +654,7 @@ def keytabname(request): os.unlink(keytabname) +@pytest.mark.tier1 class TestHostFalsePwdChange(XMLRPC_test): def test_join_host(self, host, keytabname): @@ -732,6 +740,7 @@ def dns_setup(host): pass +@pytest.mark.tier1 class TestHostDNS(XMLRPC_test): def test_add_ipv6only_host(self, dns_setup, ipv6only_host): ipv6only_host.run_command('dnsrecord_add', dnszone, @@ -858,6 +867,7 @@ def allowedto_context(request, host3): description=u'Test hostgroup 1') +@pytest.mark.tier1 class TestHostAllowedTo(XMLRPC_test): def test_user_allow_retrieve_keytab(self, allowedto_context, host): diff --git a/ipatests/test_xmlrpc/test_hostgroup_plugin.py b/ipatests/test_xmlrpc/test_hostgroup_plugin.py index 017d8ad2d..58665f466 100644 --- a/ipatests/test_xmlrpc/test_hostgroup_plugin.py +++ b/ipatests/test_xmlrpc/test_hostgroup_plugin.py @@ -26,6 +26,7 @@ from ipalib import api, errors from ipatests.test_xmlrpc.xmlrpc_test import Declarative, fuzzy_uuid from ipatests.test_xmlrpc import objectclasses from ipapython.dn import DN +import pytest hostgroup1 = u'testhostgroup1' dn1 = DN(('cn',hostgroup1),('cn','hostgroups'),('cn','accounts'), @@ -42,6 +43,7 @@ host_dn1 = DN(('fqdn',fqdn1),('cn','computers'),('cn','accounts'), invalidhostgroup1 = u'@invalid' +@pytest.mark.tier1 class test_hostgroup(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_idviews_plugin.py b/ipatests/test_xmlrpc/test_idviews_plugin.py index 287555881..205b0fc0e 100644 --- a/ipatests/test_xmlrpc/test_idviews_plugin.py +++ b/ipatests/test_xmlrpc/test_idviews_plugin.py @@ -33,6 +33,7 @@ from ipatests.test_xmlrpc.test_user_plugin import get_user_result from ipatests.test_xmlrpc.test_group_plugin import get_group_dn from ipatests.util import Fuzzy from ipapython.dn import DN +import pytest if six.PY3: unicode = str @@ -122,6 +123,7 @@ def get_hostgroup_netgroup_dn(hostgroup): api.env.basedn) +@pytest.mark.tier1 class test_idviews(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_krbtpolicy.py b/ipatests/test_xmlrpc/test_krbtpolicy.py index 84ca17f82..aab7b7820 100644 --- a/ipatests/test_xmlrpc/test_krbtpolicy.py +++ b/ipatests/test_xmlrpc/test_krbtpolicy.py @@ -24,9 +24,12 @@ from ipalib import api, errors from ipatests.test_xmlrpc.xmlrpc_test import Declarative from ipapython.dn import DN from ipatests.test_xmlrpc.test_user_plugin import get_user_result +import pytest user1 = u'tuser1' + +@pytest.mark.tier1 class test_krbtpolicy(Declarative): cleanup_commands = [ ('user_del', [user1], {}), @@ -100,7 +103,7 @@ class test_krbtpolicy(Declarative): dict( - desc='Update user ticket policy', + desc='Update user ticket policy', command=( 'krbtpolicy_mod', [user1], dict(krbmaxticketlife=3600) ), diff --git a/ipatests/test_xmlrpc/test_nesting.py b/ipatests/test_xmlrpc/test_nesting.py index 88ff6a18b..c3bf1ce84 100644 --- a/ipatests/test_xmlrpc/test_nesting.py +++ b/ipatests/test_xmlrpc/test_nesting.py @@ -26,6 +26,7 @@ from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits, fuzzy_uuid) from ipapython.dn import DN from ipatests.test_xmlrpc.test_user_plugin import get_user_result +import pytest group1 = u'testgroup1' group2 = u'testgroup2' @@ -48,6 +49,7 @@ host_dn1 = DN(('fqdn',fqdn1),('cn','computers'),('cn','accounts'), api.env.basedn) +@pytest.mark.tier1 class test_nesting(Declarative): cleanup_commands = [ ('group_del', [group1], {}), diff --git a/ipatests/test_xmlrpc/test_netgroup_plugin.py b/ipatests/test_xmlrpc/test_netgroup_plugin.py index 10553c21f..611bdf2ff 100644 --- a/ipatests/test_xmlrpc/test_netgroup_plugin.py +++ b/ipatests/test_xmlrpc/test_netgroup_plugin.py @@ -31,6 +31,7 @@ from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits, from ipatests.test_xmlrpc import objectclasses from ipapython.dn import DN from ipatests.test_xmlrpc.test_user_plugin import get_user_result +import pytest # Global so we can save the value between tests netgroup_dn = None @@ -63,6 +64,8 @@ invalidnisdomain1=u'domain1,domain2' invalidnisdomain2=u'+invalidnisdomain' invalidhost=u'+invalid&host' + +@pytest.mark.tier1 class test_netgroup(Declarative): """ Test the `netgroup` plugin. diff --git a/ipatests/test_xmlrpc/test_old_permission_plugin.py b/ipatests/test_xmlrpc/test_old_permission_plugin.py index 87a3e8b54..c7c300446 100644 --- a/ipatests/test_xmlrpc/test_old_permission_plugin.py +++ b/ipatests/test_xmlrpc/test_old_permission_plugin.py @@ -30,6 +30,7 @@ from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits, fuzzy_uuid) from ipapython.dn import DN +import pytest permission1 = u'testperm' permission1_dn = DN(('cn',permission1), @@ -91,6 +92,8 @@ users_dn = DN(api.env.container_user, api.env.basedn) groups_dn = DN(api.env.container_group, api.env.basedn) hbac_dn = DN(api.env.container_hbac, api.env.basedn) + +@pytest.mark.tier1 class test_old_permission(Declarative): default_version = u'2.65' diff --git a/ipatests/test_xmlrpc/test_passwd_plugin.py b/ipatests/test_xmlrpc/test_passwd_plugin.py index 916dd9e12..2945d7040 100644 --- a/ipatests/test_xmlrpc/test_passwd_plugin.py +++ b/ipatests/test_xmlrpc/test_passwd_plugin.py @@ -27,8 +27,10 @@ from nose.tools import assert_raises # pylint: disable=E0611 from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test, assert_attr_equal from ipalib import api from ipalib import errors +import pytest +@pytest.mark.tier1 class test_passwd(XMLRPC_test): """ Test the `passwd` plugin. diff --git a/ipatests/test_xmlrpc/test_permission_plugin.py b/ipatests/test_xmlrpc/test_permission_plugin.py index b9c8d1b98..d0bee97df 100644 --- a/ipatests/test_xmlrpc/test_permission_plugin.py +++ b/ipatests/test_xmlrpc/test_permission_plugin.py @@ -32,6 +32,7 @@ from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import Declarative from ipapython.dn import DN import inspect +import pytest try: from ipaserver.plugins.ldap2 import ldap2 @@ -145,6 +146,7 @@ def lineinfo(level): return '%s:%s' % (filename, lineno) +@pytest.mark.tier1 class test_permission_negative(Declarative): """Make sure invalid operations fail""" @@ -386,6 +388,7 @@ class test_permission_negative(Declarative): ] +@pytest.mark.tier1 class test_permission(Declarative): """Misc. tests for the permission plugin""" cleanup_commands = [ @@ -1722,6 +1725,7 @@ class test_permission_rollback(Declarative): ] + _verifications +@pytest.mark.tier1 class test_permission_sync_attributes(Declarative): """Test the effects of setting permission attributes""" cleanup_commands = [ @@ -2244,6 +2248,7 @@ class test_permission_sync_nice(Declarative): ] +@pytest.mark.tier1 class test_permission_targetfilter(Declarative): """Test the targetfilter options on permissions""" cleanup_commands = [ @@ -2807,6 +2812,7 @@ def _make_permission_flag_tests(flags, expected_message): ] +@pytest.mark.tier1 class test_permission_flags(Declarative): """Test that permission flags are handled correctly""" cleanup_commands = [ @@ -2852,6 +2858,8 @@ def check_legacy_results(results): assert len(legacy_permissions) == 9, len(legacy_permissions) return True + +@pytest.mark.tier1 class test_permission_legacy(Declarative): """Tests for non-upgraded permissions""" @@ -2870,6 +2878,7 @@ class test_permission_legacy(Declarative): ] +@pytest.mark.tier1 class test_permission_bindtype(Declarative): cleanup_commands = [ ('permission_del', [permission1], {'force': True}), @@ -3159,6 +3168,7 @@ class test_permission_bindtype(Declarative): ] +@pytest.mark.tier1 class test_managed_permissions(Declarative): cleanup_commands = [ ('permission_del', [permission1], {'force': True}), @@ -3689,6 +3699,7 @@ class test_managed_permissions(Declarative): ] +@pytest.mark.tier1 class test_permission_filters(Declarative): """Test multi-valued filters, type, memberof""" cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_ping_plugin.py b/ipatests/test_xmlrpc/test_ping_plugin.py index bdbb91e4f..e1c772ad6 100644 --- a/ipatests/test_xmlrpc/test_ping_plugin.py +++ b/ipatests/test_xmlrpc/test_ping_plugin.py @@ -25,8 +25,10 @@ from ipalib import api, errors, messages, _ from ipatests.util import Fuzzy from ipatests.test_xmlrpc.xmlrpc_test import Declarative from ipapython.version import API_VERSION +import pytest +@pytest.mark.tier1 class test_ping(Declarative): tests = [ diff --git a/ipatests/test_xmlrpc/test_privilege_plugin.py b/ipatests/test_xmlrpc/test_privilege_plugin.py index 9b3d50388..148f7d1fe 100644 --- a/ipatests/test_xmlrpc/test_privilege_plugin.py +++ b/ipatests/test_xmlrpc/test_privilege_plugin.py @@ -26,6 +26,7 @@ from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits, fuzzy_uuid) from ipapython.dn import DN +import pytest permission1 = u'testperm' permission1_dn = DN(('cn',permission1), @@ -42,6 +43,7 @@ privilege1_dn = DN(('cn',privilege1), users_dn = DN(api.env.container_user, api.env.basedn) +@pytest.mark.tier1 class test_privilege(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_pwpolicy_plugin.py b/ipatests/test_xmlrpc/test_pwpolicy_plugin.py index 3739aa893..7cbb9bad4 100644 --- a/ipatests/test_xmlrpc/test_pwpolicy_plugin.py +++ b/ipatests/test_xmlrpc/test_pwpolicy_plugin.py @@ -29,7 +29,10 @@ from ipapython.dn import DN from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import (XMLRPC_test, assert_attr_equal, Declarative) +import pytest + +@pytest.mark.tier1 class test_pwpolicy(XMLRPC_test): """ Test the `pwpolicy` plugin. @@ -245,6 +248,7 @@ class test_pwpolicy(XMLRPC_test): api.Command['user_del'](self.user) +@pytest.mark.tier1 class test_pwpolicy_mod_cospriority(Declarative): """Tests for cospriority modifications""" cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_radiusproxy_plugin.py b/ipatests/test_xmlrpc/test_radiusproxy_plugin.py index 076712777..30df17e7e 100644 --- a/ipatests/test_xmlrpc/test_radiusproxy_plugin.py +++ b/ipatests/test_xmlrpc/test_radiusproxy_plugin.py @@ -25,6 +25,7 @@ from ipapython.dn import DN from ipatests.test_xmlrpc.xmlrpc_test import Declarative from ipatests.test_xmlrpc.test_user_plugin import get_user_result from ipatests.test_xmlrpc import objectclasses +import pytest if six.PY3: unicode = str @@ -36,6 +37,7 @@ user1 = u'tuser1' password1 = u'very*secure123' +@pytest.mark.tier1 class test_raduisproxy(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_range_plugin.py b/ipatests/test_xmlrpc/test_range_plugin.py index 29af35306..30e67ca7c 100644 --- a/ipatests/test_xmlrpc/test_range_plugin.py +++ b/ipatests/test_xmlrpc/test_range_plugin.py @@ -29,6 +29,7 @@ from ipatests.test_xmlrpc import objectclasses from ipatests.util import MockLDAP from ipapython.dn import DN from ipatests.test_xmlrpc.test_user_plugin import get_user_result +import pytest if six.PY3: unicode = str @@ -388,6 +389,7 @@ group1 = u'group1' group1_gid = id_shift + 900100 +@pytest.mark.tier1 class test_range(Declarative): @classmethod def setup_class(cls): diff --git a/ipatests/test_xmlrpc/test_realmdomains_plugin.py b/ipatests/test_xmlrpc/test_realmdomains_plugin.py index 5855e7579..cd35729ed 100644 --- a/ipatests/test_xmlrpc/test_realmdomains_plugin.py +++ b/ipatests/test_xmlrpc/test_realmdomains_plugin.py @@ -24,6 +24,7 @@ from ipalib import api, errors from ipapython.dn import DN from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import Declarative +import pytest cn = u'Realm Domains' @@ -34,6 +35,7 @@ new_domain_2 = u'example2.com' bad_domain = u'doesnotexist.test' +@pytest.mark.tier1 class test_realmdomains(Declarative): # Make sure your environment has sound DNS configuration where diff --git a/ipatests/test_xmlrpc/test_replace.py b/ipatests/test_xmlrpc/test_replace.py index 48444b42a..1420e7d87 100644 --- a/ipatests/test_xmlrpc/test_replace.py +++ b/ipatests/test_xmlrpc/test_replace.py @@ -27,10 +27,12 @@ gen_modlist code. from ipatests.test_xmlrpc.xmlrpc_test import Declarative from ipatests.test_xmlrpc.test_user_plugin import get_user_result +import pytest user1=u'tuser1' +@pytest.mark.tier1 class test_replace(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_role_plugin.py b/ipatests/test_xmlrpc/test_role_plugin.py index 863cdb112..70b5f6165 100644 --- a/ipatests/test_xmlrpc/test_role_plugin.py +++ b/ipatests/test_xmlrpc/test_role_plugin.py @@ -27,6 +27,7 @@ from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits, fuzzy_uuid) from ipapython.dn import DN +import pytest search = u'test-role' @@ -48,6 +49,8 @@ privilege1 = u'r,w privilege 1' privilege1_dn = DN(('cn', privilege1), DN(api.env.container_privilege), api.env.basedn) + +@pytest.mark.tier1 class test_role(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_selfservice_plugin.py b/ipatests/test_xmlrpc/test_selfservice_plugin.py index 1f6ebb7fb..eed1a2d7e 100644 --- a/ipatests/test_xmlrpc/test_selfservice_plugin.py +++ b/ipatests/test_xmlrpc/test_selfservice_plugin.py @@ -25,10 +25,13 @@ from ipalib import api, errors from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits, fuzzy_uuid) +import pytest selfservice1 = u'testself' invalid_selfservice1 = u'bad+name' + +@pytest.mark.tier1 class test_selfservice(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_selinuxusermap_plugin.py b/ipatests/test_xmlrpc/test_selinuxusermap_plugin.py index d67251621..b8beba6e4 100644 --- a/ipatests/test_xmlrpc/test_selinuxusermap_plugin.py +++ b/ipatests/test_xmlrpc/test_selinuxusermap_plugin.py @@ -27,6 +27,7 @@ from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_digits, from ipapython.dn import DN from ipatests.util import Fuzzy from ipatests.test_xmlrpc.test_user_plugin import get_user_result +import pytest rule1 = u'selinuxrule1' selinuxuser1 = u'guest_u:s0' @@ -55,6 +56,7 @@ fuzzy_hbacruledn = Fuzzy( allow_all_rule_dn = api.Command['hbacrule_show'](u'allow_all')['result']['dn'] +@pytest.mark.tier1 class test_selinuxusermap(Declarative): cleanup_commands = [ ('selinuxusermap_del', [rule1], {}), diff --git a/ipatests/test_xmlrpc/test_service_plugin.py b/ipatests/test_xmlrpc/test_service_plugin.py index 78ba60a69..ecc5248a9 100644 --- a/ipatests/test_xmlrpc/test_service_plugin.py +++ b/ipatests/test_xmlrpc/test_service_plugin.py @@ -31,6 +31,7 @@ from ipatests.test_xmlrpc.test_user_plugin import ( get_user_result, get_user_dn, get_group_dn) import base64 from ipapython.dn import DN +import pytest fqdn1 = u'testhost1.%s' % api.env.domain fqdn2 = u'testhost2.%s' % api.env.domain @@ -60,6 +61,8 @@ hostgroup1 = u'testhostgroup1' hostgroup1_dn = DN(('cn',hostgroup1),('cn','hostgroups'),('cn','accounts'), api.env.basedn) + +@pytest.mark.tier1 class test_service(Declarative): cleanup_commands = [ @@ -648,6 +651,7 @@ class test_service(Declarative): ] +@pytest.mark.tier1 class test_service_in_role(Declarative): cleanup_commands = [ ('host_del', [fqdn1], {}), @@ -771,6 +775,7 @@ class test_service_in_role(Declarative): ] +@pytest.mark.tier1 class test_service_allowed_to(Declarative): cleanup_commands = [ ('user_del', [user1], {}), diff --git a/ipatests/test_xmlrpc/test_servicedelegation_plugin.py b/ipatests/test_xmlrpc/test_servicedelegation_plugin.py index 0eb4b9853..02dc0800f 100644 --- a/ipatests/test_xmlrpc/test_servicedelegation_plugin.py +++ b/ipatests/test_xmlrpc/test_servicedelegation_plugin.py @@ -9,6 +9,7 @@ from ipalib import api, errors from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import Declarative from ipapython.dn import DN +import pytest rule1 = u'test1' rule2 = u'test rule two' @@ -22,6 +23,7 @@ def get_servicedelegation_dn(cn): return DN(('cn', cn), api.env.container_s4u2proxy, api.env.basedn) +@pytest.mark.tier1 class test_servicedelegation(Declarative): cleanup_commands = [ ('servicedelegationrule_del', [rule1], {}), diff --git a/ipatests/test_xmlrpc/test_stageuser_plugin.py b/ipatests/test_xmlrpc/test_stageuser_plugin.py index b09ef6e84..43c59b7c7 100644 --- a/ipatests/test_xmlrpc/test_stageuser_plugin.py +++ b/ipatests/test_xmlrpc/test_stageuser_plugin.py @@ -389,6 +389,7 @@ def user7(request): return tracker.make_fixture_restore(request) +@pytest.mark.tier1 class TestNonexistentStagedUser(XMLRPC_test): def test_retrieve_nonexistent(self, stageduser): stageduser.ensure_missing() @@ -426,6 +427,7 @@ class TestNonexistentStagedUser(XMLRPC_test): command() +@pytest.mark.tier1 class TestStagedUser(XMLRPC_test): def test_create_duplicate(self, stageduser): stageduser.ensure_exists() @@ -518,6 +520,7 @@ class TestStagedUser(XMLRPC_test): stageduser.retrieve() +@pytest.mark.tier1 class TestCreateInvalidAttributes(XMLRPC_test): def test_create_invalid_uid(self): invalid = StageUserTracker(invaliduser1, u'invalid', u'user') @@ -586,6 +589,7 @@ class TestCreateInvalidAttributes(XMLRPC_test): command() +@pytest.mark.tier1 class TestUpdateInvalidAttributes(XMLRPC_test): def test_update_uid_string(self, stageduser): stageduser.ensure_exists() @@ -620,6 +624,7 @@ class TestUpdateInvalidAttributes(XMLRPC_test): command() +@pytest.mark.tier1 class TestActive(XMLRPC_test): def test_delete(self, user): user.ensure_exists() @@ -659,6 +664,7 @@ class TestActive(XMLRPC_test): command() +@pytest.mark.tier1 class TestPreserved(XMLRPC_test): def test_search_preserved_invalid(self, user): user.make_preserved_user() @@ -752,6 +758,7 @@ class TestPreserved(XMLRPC_test): stageduser.delete() +@pytest.mark.tier1 class TestManagers(XMLRPC_test): def test_staged_manager(self, user, stageduser): user.ensure_exists() @@ -795,6 +802,7 @@ class TestManagers(XMLRPC_test): assert False +@pytest.mark.tier1 class TestDuplicates(XMLRPC_test): def test_active_same_as_preserved(self, user4, user5): user4.ensure_missing() @@ -851,6 +859,7 @@ def group(request): return tracker.make_fixture(request) +@pytest.mark.tier1 class TestGroups(XMLRPC_test): def test_stageduser_membership(self, stageduser, group): stageduser.ensure_exists() diff --git a/ipatests/test_xmlrpc/test_sudocmd_plugin.py b/ipatests/test_xmlrpc/test_sudocmd_plugin.py index 2bcf4920f..2056118ba 100644 --- a/ipatests/test_xmlrpc/test_sudocmd_plugin.py +++ b/ipatests/test_xmlrpc/test_sudocmd_plugin.py @@ -25,6 +25,7 @@ from ipalib import errors from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_sudocmddn, fuzzy_uuid) from ipatests.test_xmlrpc import objectclasses +import pytest sudocmd1 = u'/usr/bin/sudotestcmd1' sudocmd1_camelcase = u'/usr/bin/sudoTestCmd1' @@ -32,6 +33,7 @@ sudocmd1_camelcase = u'/usr/bin/sudoTestCmd1' sudorule1 = u'test_sudorule1' +@pytest.mark.tier1 class test_sudocmd(Declarative): cleanup_commands = [ diff --git a/ipatests/test_xmlrpc/test_sudocmdgroup_plugin.py b/ipatests/test_xmlrpc/test_sudocmdgroup_plugin.py index 18980d777..c72ba2f7a 100644 --- a/ipatests/test_xmlrpc/test_sudocmdgroup_plugin.py +++ b/ipatests/test_xmlrpc/test_sudocmdgroup_plugin.py @@ -25,6 +25,7 @@ from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import (Declarative, fuzzy_uuid, fuzzy_sudocmddn) from ipapython.dn import DN +import pytest sudocmdgroup1 = u'testsudocmdgroup1' sudocmdgroup2 = u'testsudocmdgroup2' @@ -51,6 +52,8 @@ def create_command(sudocmd): ), ) + +@pytest.mark.tier1 class test_sudocmdgroup(Declarative): cleanup_commands = [ ('sudocmdgroup_del', [sudocmdgroup1], {}), diff --git a/ipatests/test_xmlrpc/test_sudorule_plugin.py b/ipatests/test_xmlrpc/test_sudorule_plugin.py index 7d8735c49..ef21f28b4 100644 --- a/ipatests/test_xmlrpc/test_sudorule_plugin.py +++ b/ipatests/test_xmlrpc/test_sudorule_plugin.py @@ -27,11 +27,13 @@ import six from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test, assert_attr_equal from ipalib import api from ipalib import errors +import pytest if six.PY3: unicode = str +@pytest.mark.tier1 class test_sudorule(XMLRPC_test): """ Test the `sudorule` plugin. diff --git a/ipatests/test_xmlrpc/test_trust_plugin.py b/ipatests/test_xmlrpc/test_trust_plugin.py index b5f53a78d..54ac96737 100644 --- a/ipatests/test_xmlrpc/test_trust_plugin.py +++ b/ipatests/test_xmlrpc/test_trust_plugin.py @@ -29,6 +29,7 @@ from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import ( Declarative, fuzzy_guid, fuzzy_domain_sid, fuzzy_string, fuzzy_uuid, fuzzy_digits) +import pytest if six.PY3: unicode = str @@ -42,6 +43,8 @@ testgroup_dn = DN(('cn', testgroup), api.env.container_group, api.env.basedn) default_group = u'Default SMB Group' default_group_dn = DN(('cn', default_group), api.env.container_group, api.env.basedn) + +@pytest.mark.tier1 class test_trustconfig(Declarative): @classmethod diff --git a/ipatests/test_xmlrpc/test_user_plugin.py b/ipatests/test_xmlrpc/test_user_plugin.py index 3d7b5e6ba..81185e449 100644 --- a/ipatests/test_xmlrpc/test_user_plugin.py +++ b/ipatests/test_xmlrpc/test_user_plugin.py @@ -37,6 +37,7 @@ from xmlrpc_test import ( fuzzy_string, fuzzy_dergeneralizedtime, add_sid, add_oc, raises_exact) from ipapython.dn import DN from ipatests.test_xmlrpc.ldaptracker import Tracker +import pytest user1 = u'tuser1' user2 = u'tuser2' @@ -181,6 +182,7 @@ def not_upg_check(response): return True +@pytest.mark.tier1 class test_user(Declarative): cleanup_commands = [ @@ -1608,6 +1610,7 @@ class test_user(Declarative): ] +@pytest.mark.tier1 class test_denied_bind_with_expired_principal(XMLRPC_test): password = u'random' diff --git a/ipatests/test_xmlrpc/test_vault_plugin.py b/ipatests/test_xmlrpc/test_vault_plugin.py index 6992005b8..5a0acb170 100644 --- a/ipatests/test_xmlrpc/test_vault_plugin.py +++ b/ipatests/test_xmlrpc/test_vault_plugin.py @@ -24,6 +24,7 @@ Test the `ipalib/plugins/vault.py` module. import nose from ipalib import api, errors from ipatests.test_xmlrpc.xmlrpc_test import Declarative, fuzzy_string +import pytest vault_name = u'test_vault' service_name = u'HTTP/server.example.com' @@ -124,6 +125,7 @@ veCYju6ok4ZWnMiH8MR1jgC39RWtjJZwynCuPXUP2/vZkoVf1tCZyz7dSm8TdS/2 """ +@pytest.mark.tier1 class test_vault_plugin(Declarative): @classmethod -- cgit