Skip to content

Commit

Permalink
Test: Minor update
Browse files Browse the repository at this point in the history
Signed-off-by: Madhuri Upadhye <[email protected]>
  • Loading branch information
madhuriupadhye committed Dec 7, 2023
1 parent 2de907b commit 2966a59
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/tests/multihost/ipa/test_subid_ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def ipa_subid_find(multihost):
@pytest.mark.usefixtures('environment_setup',
'subid_generate',
'bkp_cnfig_for_subid_files')
@pytest.mark.tier1
@pytest.mark.tier4
class TestSubid(object):
"""
This is for ipa bugs automation
Expand All @@ -60,19 +60,22 @@ def test_podmanmap_feature(multihost):
2. Should succeed
"""
ipa_subid_find(multihost)
multihost.client[0].run_command(f'su - admin -c "rm -rf /home/admin/.local/share/containers"', raiseonerr=False)
multihost.client[0].run_command(f"podman system migrate", raiseonerr=False)
multihost.client[0].run_command(f"sysctl user.max_user_namespaces=15000", raiseonerr=False)
map1 = "/proc/self/uid_map"
cmd = multihost.client[0].run_command(
f'su - {USER} -c "podman unshare cat {map1}"', raiseonerr=False)
actual_result = cmd.stdout_text.splitlines()

# assert str(uid_start) == actual_result[1].split()[1]
# assert str(uid_range) == actual_result[1].split()[2]
assert str(uid_start) == actual_result[1].split()[1]
assert str(uid_range) == actual_result[1].split()[2]
map2 = "/proc/self/gid_map"
cmd = multihost.client[0].run_command(
f'su - {USER} -c "podman unshare cat {map2}"', raiseonerr=False)
actual_result = cmd.stdout_text.splitlines()
# assert str(gid_start) == actual_result[1].split()[1]
# assert str(gid_range) == actual_result[1].split()[2]
assert str(gid_start) == actual_result[1].split()[1]
assert str(gid_range) == actual_result[1].split()[2]

@staticmethod
def test_subid_feature(multihost):
Expand Down Expand Up @@ -156,3 +159,4 @@ def test_list_subid_ranges(multihost):
assert str(USER) == cmd.stdout_text.split()[1]
assert str(gid_start) == cmd.stdout_text.split()[2]
assert str(gid_range) == cmd.stdout_text.split()[3]

0 comments on commit 2966a59

Please sign in to comment.