URL: https://github.com/SSSD/sssd/pull/5891
Author: aborah-sudo
 Title: #5891: Tests: Podman supports subid ranges managed by FreeIPA
Action: opened

PR body:
"""
Podman supports subid ranges managed by FreeIPA
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/5891/head:pr5891
git checkout pr5891
From ddbec65beddbb3919b78344b7baba4494337035c Mon Sep 17 00:00:00 2001
From: Anuj Borah <abo...@redhat.com>
Date: Mon, 29 Nov 2021 14:28:36 +0530
Subject: [PATCH] Tests: Podman supports subid ranges managed by FreeIPA

Podman supports subid ranges managed by FreeIPA
---
 src/tests/multihost/ipa/conftest.py          |  1 +
 src/tests/multihost/ipa/test_subid_ranges.py | 33 ++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/src/tests/multihost/ipa/conftest.py b/src/tests/multihost/ipa/conftest.py
index 4bf9061c58..ab8d85dd93 100644
--- a/src/tests/multihost/ipa/conftest.py
+++ b/src/tests/multihost/ipa/conftest.py
@@ -176,6 +176,7 @@ def environment_setup(session_multihost, request):
                        "--enablerepo=rhel-CRB install"
                        " -y shadow-utils*")
     client.run_command("yum install -y gcc")
+    client.run_command("yum install -y podman")
     with pytest.raises(subprocess.CalledProcessError):
         client.run_command(f"grep subid /etc/nsswitch.conf")
     file_location = "/src/tests/multihost/ipa/data/list_subid_ranges.c"
diff --git a/src/tests/multihost/ipa/test_subid_ranges.py b/src/tests/multihost/ipa/test_subid_ranges.py
index b3df9b3d60..d98c6418bf 100644
--- a/src/tests/multihost/ipa/test_subid_ranges.py
+++ b/src/tests/multihost/ipa/test_subid_ranges.py
@@ -47,6 +47,39 @@ class TestSubid(object):
     """
     This is for ipa bugs automation
     """
+    def test_podmanmap_feature(self, multihost):
+        """
+        :Title: Podman supports subid ranges managed by FreeIPA
+        :id: 0e86df9c-50f1-11ec-82f3-845cf3eff344
+        :customerscenario: true
+        :bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1803943
+        :steps:
+            1. Test podman finds proper uid_map
+            2. Test podman finds proper gid_map
+        :expectedresults:
+            1. Should succeed
+            2. Should succeed
+        """
+        ipa_subid_find(multihost)
+        ssh1 = SSHClient(multihost.client[0].ip,
+                         username=user,
+                         password=test_password)
+        (results1, results2, results3) = ssh1.exec_command("podman "
+                                                           "unshare "
+                                                           "cat "
+                                                           "/proc/self/uid_map")
+        actual_result = results2.readlines()
+        assert str(uid_start) == actual_result[1].split()[1]
+        assert str(uid_range) == actual_result[1].split()[2]
+        (results1, results2, results3) = ssh1.exec_command("podman "
+                                                           "unshare "
+                                                           "cat "
+                                                           "/proc/self/gid_map")
+        actual_result = results2.readlines()
+        assert str(gid_start) == actual_result[1].split()[1]
+        assert str(gid_range) == actual_result[1].split()[2]
+        ssh1.close()
+
     def test_subid_feature(self, multihost):
         """
         :Title: support subid ranges managed by FreeIPA
_______________________________________________
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://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/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to