Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stig ipa #7070

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tests/multihost/ipa/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@
" -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("grep subid /etc/nsswitch.conf")
# with pytest.raises(subprocess.CalledProcessError):
# client.run_command("grep subid /etc/nsswitch.conf")
Comment on lines +226 to +227

Check notice

Code scanning / CodeQL

Commented-out code Note test

This comment appears to contain commented-out code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was it here and why is it being removed?

Copy link
Contributor Author

@madhuriupadhye madhuriupadhye Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why it was here.

I removed for two reasons:

  1. While checking it always comes with exit code as a 1, with stig and non-stig also.
  2. There is no thread running, but with thread error code enters in deadlock and stuck there.
2023-12-08 10:12:27,123 - sssd.testlib.common.qe_class.QeHost.client.cmd412 - DEBUG - RUN grep subid /etc/nsswitch.conf
^C
Program interrupted. (Use 'cont' to resume).
> /usr/lib64/python3.11/threading.py(1133)_wait_for_tstate_lock()
-> lock.release()

If we need to add them better we add with regex but not with grep command.

file_location = "/data/list_subid_ranges.c"
client.transport.put_file(os.path.dirname(os.path.abspath(__file__))
+ file_location,
Expand Down
10 changes: 9 additions & 1 deletion 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for testing, will update once changes in test looks good.

class TestSubid(object):
"""
This is for ipa bugs automation
Expand All @@ -60,13 +60,20 @@ 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]
#enable_lin = actual_result[0].split()[1]
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"loginctl enable-linger {actual_result[0].split()[1]}", raiseonerr=False)
map2 = "/proc/self/gid_map"
cmd = multihost.client[0].run_command(
f'su - {USER} -c "podman unshare cat {map2}"', raiseonerr=False)
Expand Down Expand Up @@ -156,3 +163,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]

Loading