URL: https://github.com/freeipa/freeipa/pull/5978
Author: menonsudhir
 Title: #5978: ipatests: Additional tests for ipa subordinate ids
Action: opened

PR body:
"""
1. Test check that when no subid is provided in ipa subid-show command error 
message is displayed on the console.
2. Test check that when regular ipa user tries to generate subid an error is 
displayed

"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/5978/head:pr5978
git checkout pr5978
From 5d60482bf9197d7c98b8c5e584b6a9d098314422 Mon Sep 17 00:00:00 2001
From: Sudhir Menon <sume...@redhat.com>
Date: Wed, 11 Aug 2021 16:22:43 +0530
Subject: [PATCH 1/2] ipatests: Additional tests for ipa subordinate ids

1. Tests check that when no subid is provided in ipa subid-show
command error message is displayed on the console.
2. Test check that when regular ipa user tries
to generate subid an error is displayed

Signed-off-by: Sudhir Menon <sume...@redhat.com>
---
 ipatests/test_integration/test_subids.py | 26 ++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/ipatests/test_integration/test_subids.py b/ipatests/test_integration/test_subids.py
index 28cd1f765cd..013f7bed5ac 100644
--- a/ipatests/test_integration/test_subids.py
+++ b/ipatests/test_integration/test_subids.py
@@ -253,3 +253,29 @@ def test_idrange_subid(self):
     def test_subid_stats(self):
         tasks.kinit_admin(self.master)
         self.master.run_command(["ipa", "subid-stats"])
+
+    def test_subid_show(self):
+        '''
+        Test checks that error message is displayed
+        when no subid is specified while running subid-show command
+                '''
+        err_msg = 'ipa: ERROR: 'id' is required'
+        cmd = self.master.run_command(["ipa", "subid-show", ''])
+        assert err_msg in cmd.stderr_text
+
+    def test_add_subid_range_as_regular_ipauser(self):
+        '''
+        Test checks that when regular ipauser tries to add
+        subid range it generates an error
+        '''
+        error_msg = (
+            'ipa: ERROR: Insufficient access: '
+            'Insufficient 'add' privilege to add the entry'
+        )
+        tasks.kinit_admin(self.master)
+        uid = 'ipauser1'
+        tasks.user_add(self.master, uid)
+        self.master.run_command(["kdestroy", "-A"])
+        tasks.kinit_as_user(self.master, uid, password=password)
+        cmd = self.subuid.generate(uid)
+        assert err in cmd.stderr_text

From 40895f59018888fd04f18dedcdfcc0b0c0bab238 Mon Sep 17 00:00:00 2001
From: Sudhir Menon <sume...@redhat.com>
Date: Mon, 16 Aug 2021 13:00:02 +0530
Subject: [PATCH 2/2] Temp commit

Signed-off-by: Sudhir Menon <sume...@redhat.com>
---
 .freeipa-pr-ci.yaml                        | 2 +-
 ipatests/prci_definitions/temp_commit.yaml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.freeipa-pr-ci.yaml b/.freeipa-pr-ci.yaml
index abcf8c5b634..80656690080 120000
--- a/.freeipa-pr-ci.yaml
+++ b/.freeipa-pr-ci.yaml
@@ -1 +1 @@
-ipatests/prci_definitions/gating.yaml
\ No newline at end of file
+ipatests/prci_definitions/temp_commit.yaml
\ No newline at end of file
diff --git a/ipatests/prci_definitions/temp_commit.yaml b/ipatests/prci_definitions/temp_commit.yaml
index 4b0398b9218..4c929942b6a 100644
--- a/ipatests/prci_definitions/temp_commit.yaml
+++ b/ipatests/prci_definitions/temp_commit.yaml
@@ -68,7 +68,7 @@ jobs:
       class: RunPytest
       args:
         build_url: '{fedora-latest/build_url}'
-        test_suite: test_integration/test_REPLACEME.py
+        test_suite: test_integration/test_subids.py::TestSubordinateId
         template: *ci-master-latest
         timeout: 3600
         topology: *master_1repl_1client
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to