File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
sssd_test_framework/utils Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 66from io import StringIO
77from typing import TYPE_CHECKING , Literal
88
9+ import pytest
910from pytest_mh import MultihostHost , MultihostRole , MultihostUtility
1011from pytest_mh .conn import Process , ProcessLogLevel , ProcessResult
1112
@@ -358,6 +359,11 @@ def set_service_user(self, user: str) -> None:
358359 return # requested service user matches default, nothing to do
359360
360361 service_file = "/usr/lib/systemd/system/sssd.service"
362+ rw = self .host .conn .run (f"test -w { service_file } " , raise_on_error = False )
363+ if rw .rc != 0 :
364+ # Can't change service user on read only filesystem
365+ pytest .skip (f"Cannot write { service_file } " )
366+
361367 self .fs .backup (service_file )
362368 cmd = f'sed -i "s/^User=.*/User={ user } /g" { service_file } \n '
363369 cmd += f'sed -i "s/^Group=.*/Group={ user } /g" { service_file } \n '
You can’t perform that action at this time.
0 commit comments