Skip to content

Commit bfe4b03

Browse files
F
1 parent 2abe258 commit bfe4b03

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

test/test_modules.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ def test_service_systemd_mask(host, docker_image):
138138
assert not ssh.is_masked
139139

140140

141+
@all_images
141142
def test_service_systemd_ssh(host, docker_image):
142143
name = "sshd" if docker_image == "rockylinux9" else "ssh"
143144
ssh = host.service(name)
@@ -147,22 +148,29 @@ def test_service_systemd_ssh(host, docker_image):
147148
assert ssh.is_running
148149

149150

151+
# service unit exists only in Rocky Linux 9
150152
@pytest.mark.testinfra_hosts("docker://rockylinux9")
151153
def test_service_systemd_root_mount(host):
152154
root = host.service("-.mount") # systemd unit for mounting /
153155
assert root.exists
154156
assert root.is_valid
155-
assert root.is_enabled
156-
assert root.is_running
157+
assert not root.is_enabled
158+
a = host.run("systemctl status -- -.mount")
159+
b = host.run("systemctl is-enabled -- -.mount")
160+
raise AssertionError(
161+
f"{a.stdout}\n{a.stderr}\n{a.rc}\n{b.stdout}\n{b.stderr}\n{b.rc}"
162+
)
163+
# assert root.is_running
157164

158165

166+
# service unit exists only in Rocky Linux 9
159167
@pytest.mark.testinfra_hosts("docker://rockylinux9")
160168
def test_service_systemd_tmp_mount(host):
161169
tmp = host.service("tmp.mount")
162170
assert tmp.exists
163171
assert tmp.is_valid
164-
assert tmp.is_enabled
165-
assert tmp.is_running
172+
assert not tmp.is_enabled
173+
assert not tmp.is_running
166174

167175

168176
def test_salt(host):

0 commit comments

Comments
 (0)