URL: https://github.com/SSSD/sssd/pull/756
Author: mrniranjan
 Title: #756: TESTS: Add test case title with @title in docstrings
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/756/head:pr756
git checkout pr756
From 629afb459fa2abf83ed2309821199367e99103f0 Mon Sep 17 00:00:00 2001
From: "Niranjan M.R" <mrniran...@redhat.com>
Date: Fri, 15 Feb 2019 17:08:36 +0530
Subject: [PATCH 1/6] TESTS: Add @Title to test case docstrings for basic
 sanity tests

Adding @Title to specify test case title makes the junit to
contain the test case title as test casename
instead of test case function

This required to create test runs for test case management
system.

Signed-off-by: Niranjan M.R <mrniran...@redhat.com>
---
 src/tests/multihost/basic/test_basic.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/tests/multihost/basic/test_basic.py b/src/tests/multihost/basic/test_basic.py
index 88e7593078..eaec8cb257 100644
--- a/src/tests/multihost/basic/test_basic.py
+++ b/src/tests/multihost/basic/test_basic.py
@@ -9,7 +9,9 @@
 class TestSanitySSSD(object):
     """ Basic Sanity Test cases """
     def test_ssh_user_login(self, multihost):
-        """Check ssh login as LDAP user with Kerberos credentials """
+        """
+        @Title: Login: Check ssh login as LDAP user with Kerberos credentials
+        """
         try:
             ssh = SSHClient(multihost.master[0].sys_hostname,
                             username='foo1', password='Secret123')
@@ -20,7 +22,9 @@ def test_ssh_user_login(self, multihost):
             ssh.close()
 
     def test_kinit(self, multihost):
-        """ Run kinit after user login """
+        """
+        @Title: Login: Verify kinit is successfull after user login
+        """
         try:
             ssh = SSHClient(multihost.master[0].sys_hostname,
                             username='foo2', password='Secret123')
@@ -37,7 +41,7 @@ def test_kinit(self, multihost):
                 ssh.close()
 
     def test_offline_ssh_login(self, multihost):
-        """ Test Offline ssh login """
+        """@Title: Login: Verify offline ssh login"""
         multihost.master[0].transport.get_file('/etc/sssd/sssd.conf',
                                                '/tmp/sssd.conf')
         sssdconfig = ConfigParser.RawConfigParser()

From b470d57bd65e857f175dff9165e1a00a1b15dffd Mon Sep 17 00:00:00 2001
From: "Niranjan M.R" <mrniran...@redhat.com>
Date: Fri, 15 Feb 2019 17:16:36 +0530
Subject: [PATCH 2/6] TESTS: Add @Title to test case docstrings for config
 tests

Signed-off-by: Niranjan M.R <mrniran...@redhat.com>
---
 src/tests/multihost/basic/test_config.py | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/tests/multihost/basic/test_config.py b/src/tests/multihost/basic/test_config.py
index 3e3a76bead..231aad5143 100644
--- a/src/tests/multihost/basic/test_config.py
+++ b/src/tests/multihost/basic/test_config.py
@@ -21,8 +21,8 @@ def _assert_config_value(self, multihost, section, key, value):
 
     def test_sssd_genconf_sssd_running(self, multihost):
         """
-        Test that sssd --genconf is able to re-generate the configuration
-        even while SSSD is running.
+        @Title: config: sssd --genconf is able to re-generate
+        the configuration even while SSSD is running.
         """
         multihost.master[0].service_sssd('restart')
 
@@ -36,8 +36,8 @@ def test_sssd_genconf_sssd_running(self, multihost):
 
     def test_sssd_genconf_section_only(self, multihost):
         """
-        Test that --genconf-section only refreshes those sections given
-        on the command line
+        @Title: config: sssd --genconf-section only
+        refreshes those sections given on the command line
         """
         multihost.master[0].service_sssd('restart')
 
@@ -59,8 +59,8 @@ def test_sssd_genconf_section_only(self, multihost):
 
     def test_sssd_genconf_add_remove_section(self, multihost):
         """
-        Test that --genconf-section can not only modify existing
-        configuration sections, but also add a new section
+        @Title: config: sssd --genconf-section can not only modify
+        existing configuration sections, but also add a new section
         """
         # Establish a baseline
         multihost.master[0].service_sssd('restart')
@@ -89,8 +89,10 @@ def test_sssd_genconf_add_remove_section(self, multihost):
 
     def test_sssd_genconf_no_such_section(self, multihost):
         """
-        Referencing a non-existant section must not fail, because
-        we want to call this command from the systemd unit files
+        @Title: config: Referencing a non-existant section must not fail
+
+        @Description: Referencing a non-existant section must not fail,
+        because we want to call this command from the systemd unit files
         and by default the sections don't have to be present
         """
         multihost.master[0].service_sssd('restart')

From 511f2364b050d577da92f12f69b3b94a6b400c39 Mon Sep 17 00:00:00 2001
From: "Niranjan M.R" <mrniran...@redhat.com>
Date: Fri, 15 Feb 2019 17:16:57 +0530
Subject: [PATCH 3/6] TESTS: Add @Title to test case docstrings for KCM tests.

Pep8 Fixes

Signed-off-by: Niranjan M.R <mrniran...@redhat.com>
---
 src/tests/multihost/basic/test_kcm.py | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/tests/multihost/basic/test_kcm.py b/src/tests/multihost/basic/test_kcm.py
index 20029f57e0..54b3f7ecd0 100644
--- a/src/tests/multihost/basic/test_kcm.py
+++ b/src/tests/multihost/basic/test_kcm.py
@@ -39,7 +39,9 @@ def _kcm_log_length(self, multihost):
         return nlines
 
     def test_kinit_kcm(self, multihost, enable_kcm):
-        """ Run kinit with KRB5CCNAME=KCM: """
+        """
+        @Title: kcm: Run kinit with KRB5CCNAME=KCM
+        """
         self._start_kcm(multihost)
         try:
             ssh = SSHClient(multihost.master[0].sys_hostname,
@@ -61,7 +63,9 @@ def test_kinit_kcm(self, multihost, enable_kcm):
             ssh.close()
 
     def test_ssh_login_kcm(self, multihost, enable_kcm):
-        """ Verify ssh logins are successuful with kcm as default """
+        """
+        @Title: kcm: Verify ssh logins are successuful with kcm as default
+        """
         # pylint: disable=unused-argument
         _pytest_fixture = [enable_kcm]
         try:
@@ -77,8 +81,11 @@ def test_ssh_login_kcm(self, multihost, enable_kcm):
 
     def test_kcm_debug_level_set(self, multihost, enable_kcm):
         """
-        Test that just adding a [kcm] section and restarting the kcm
-        service enables debugging without having to restart the
+        @Title: kcm: After kcm section with debug
+        level set restaring sssd-kcm service enables kcm debugging
+
+        @Description: Test that just adding a [kcm] section and restarting
+        the kcm service enables debugging without having to restart the
         whole sssd
         """
         # Start from a known-good state where the configuration is refreshed
@@ -125,8 +132,8 @@ def test_kcm_debug_level_set(self, multihost, enable_kcm):
 
     def test_kdestroy_retval(self, multihost, enable_kcm):
         """
-        Test that destroying an empty cache does not return a non-zero
-        return code.
+        @Title: kcm: Test that destroying an empty cache does
+        not return a non-zero return code
         """
         ssh = SSHClient(multihost.master[0].sys_hostname,
                         username='foo3', password='Secret123')
@@ -142,7 +149,7 @@ def test_kdestroy_retval(self, multihost, enable_kcm):
 
     def test_ssh_forward_creds(self, multihost, enable_kcm):
         """
-        Test that SSH can forward credentials with KCM
+        @Title: kcm: Test that SSH can forward credentials with KCM
 
         A regression test for https://pagure.io/SSSD/sssd/issue/3873
         """

From aa7652f9a693039c5750df39b1a78af39196e1da Mon Sep 17 00:00:00 2001
From: "Niranjan M.R" <mrniran...@redhat.com>
Date: Fri, 15 Feb 2019 17:17:12 +0530
Subject: [PATCH 4/6] TESTS: Add @Title to test case docstrings for sssctl
 config tests.

Pep8 fixes
Signed-off-by: Niranjan M.R <mrniran...@redhat.com>
---
 .../multihost/basic/test_sssctl_config_check.py     | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/tests/multihost/basic/test_sssctl_config_check.py b/src/tests/multihost/basic/test_sssctl_config_check.py
index c50c2e64a5..43b167cbf9 100644
--- a/src/tests/multihost/basic/test_sssctl_config_check.py
+++ b/src/tests/multihost/basic/test_sssctl_config_check.py
@@ -6,7 +6,10 @@
 
 class TestSssctlConfigCheck(object):
     def test_verify_typo_option_name(self, multihost):
-        """ Verify typos in option name (not value) of configuration file """
+        """
+        @Title: sssctl: Verify typos in option name (not value)
+        of configuration file
+        """
         cfgget = '/etc/sssd/sssd.conf'
         cfgput = '/tmp/sssd.conf.backup'
         multihost.master[0].run_command(['/bin/cp',
@@ -32,7 +35,9 @@ def test_verify_typo_option_name(self, multihost):
                                         raiseonerr=False)
 
     def test_verify_typo_domain_name(self, multihost):
-        """ Verify typos in domain name of configuration file """
+        """
+        @Title: sssctl: Verify typos in domain name of configuration file
+        """
         cfgget = '/etc/sssd/sssd.conf'
         cfgput = '/tmp/sssd.conf.backup'
         multihost.master[0].run_command(['/bin/cp',
@@ -58,7 +63,9 @@ def test_verify_typo_domain_name(self, multihost):
                                         raiseonerr=False)
 
     def test_misplaced_option(self, multihost):
-        """ Verify misplace options in default configuration file """
+        """
+        @Title: sssctl: Verify misplace options in default configuration file
+        """
         cfgget = '/etc/sssd/sssd.conf'
         cfgput = '/tmp/sssd.conf.backup'
         sssdcfg = multihost.master[0].get_file_contents(cfgget)

From a8753b376b3a67a2cbfe02c4fc9ba01ff407b9ac Mon Sep 17 00:00:00 2001
From: "Niranjan M.R" <mrniran...@redhat.com>
Date: Fri, 15 Feb 2019 17:17:27 +0530
Subject: [PATCH 5/6] TESTS: Add @Title to test case docstrings for sudo tests

Signed-off-by: Niranjan M.R <mrniran...@redhat.com>
---
 src/tests/multihost/basic/test_sudo.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/tests/multihost/basic/test_sudo.py b/src/tests/multihost/basic/test_sudo.py
index 0663b805bb..f1b35ba9f7 100644
--- a/src/tests/multihost/basic/test_sudo.py
+++ b/src/tests/multihost/basic/test_sudo.py
@@ -10,7 +10,9 @@ class TestSanitySudo(object):
     def test_case_senitivity(self, multihost, case_sensitive_sudorule,
                              enable_sss_sudo_nsswitch,
                              set_case_sensitive_false):
-        """ Verify case sensitivity in sudo responder """
+        """
+        @Title: sudo: Verify case sensitivity in sudo responder
+        """
         # pylint: disable=unused-argument
         _pytest_fixtures = [case_sensitive_sudorule, enable_sss_sudo_nsswitch,
                             set_case_sensitive_false]
@@ -35,7 +37,10 @@ def test_refresh_expired_rule(self, multihost,
                                   enable_sss_sudo_nsswitch,
                                   generic_sudorule,
                                   set_entry_cache_sudo_timeout):
-        """ Verify refreshing expired sudo rules doesn't crash sssd_sudo """
+        """
+        @Title: sudo: Verify refreshing expired sudo rules
+        do not crash sssd_sudo
+        """
         # pylint: disable=unused-argument
         _pytest_fixtures = [enable_sss_sudo_nsswitch, generic_sudorule,
                             set_entry_cache_sudo_timeout]

From 2a83930de4b812fbc0cdfbf5021b017d072b85ab Mon Sep 17 00:00:00 2001
From: "Niranjan M.R" <mrniran...@redhat.com>
Date: Fri, 15 Feb 2019 17:17:39 +0530
Subject: [PATCH 6/6] TESTS: Add @Title to test case docstrings for files
 tests.

Signed-off-by: Niranjan M.R <mrniran...@redhat.com>
---
 src/tests/multihost/basic/test_files.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/tests/multihost/basic/test_files.py b/src/tests/multihost/basic/test_files.py
index db7608afeb..7c5e927247 100644
--- a/src/tests/multihost/basic/test_files.py
+++ b/src/tests/multihost/basic/test_files.py
@@ -23,19 +23,26 @@ class TestImplicitFilesProvider(object):
     together with another domain to stick close to what users use in Fedora
     """
     def test_files_does_not_handle_root(self, multihost):
-        """ The files provider does not handle root """
+        """
+        @Title: files: files provider does not handle root
+        """
         exit_status, _ = get_sss_user(multihost, 'root')
         assert exit_status == 2
 
     def test_files_sanity(self, multihost):
-        """ Test that the files provider can resolve a user """
+        """
+        @Title: files: Test that the files provider can resolve a user
+        """
         exit_status, _ = get_sss_user(multihost, 'lcl1')
         assert exit_status == 0
 
     def test_files_enumeration(self, multihost):
         """
-        Since nss_files enumerates and libc would concatenate the results,
-        the files provider of SSSD should not enumerate
+        @Title: files: Verify files provider do not enumerate
+
+        @Description: Since nss_files enumerates and libc would
+        concatenate the results, the files provider of SSSD should
+        not enumerate
         """
         cmd = multihost.master[0].run_command('getent passwd -s sss')
         assert len(cmd.stdout_text) == 0
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org

Reply via email to