Skip to content

Commit 8be4ea3

Browse files
committed
Properly use bootc or rpm-ostree usroverlay command
1 parent 46c3722 commit 8be4ea3

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

test/resources/ostree.resource

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,20 @@ Expected Boot Count
123123
... sudo=True return_rc=False
124124

125125
Should Be Equal As Integers ${reboot_count} ${stdout}
126+
127+
Create Usr Directory Overlay
128+
[Documentation] Make /usr dir writable by creating an overlay, rebooting
129+
... will go back to being immutable.
130+
131+
${is_bootc}= Is System Bootc
132+
IF ${is_bootc}
133+
${cmd}= Set Variable bootc usr-overlay
134+
ELSE
135+
${cmd}= Set Variable rpm-ostree usroverlay
136+
END
137+
138+
${stdout} ${stderr} ${rc}= Execute Command
139+
... ${cmd}
140+
... sudo=True return_rc=True
141+
... return_stdout=True return_stderr=True
142+
Should Be Equal As Integers 0 ${rc}

test/suites/greenboot/greenboot.robot

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,19 @@ Cleanup User Workload
9393

9494
Disrupt Service
9595
[Documentation] Prevent Microshift service from starting correctly.
96-
${is_ostree}= Is System OSTree
9796
9897
${stdout} ${rc}= Execute Command
9998
... which hostname
10099
... sudo=False return_rc=True
101100
IF ${rc} == 0 Set Suite Variable \${HOSTNAME_BIN_PATH} ${stdout}
102101

103-
${cmd}= Set Variable sudo chmod 000 ${HOSTNAME_BIN_PATH}
104-
IF ${is_ostree}
105-
${cmd}= Set Variable sudo rpm-ostree usroverlay && sudo chmod 000 ${HOSTNAME_BIN_PATH}
106-
END
102+
# This covers both ostree and bootc systems
103+
${is_ostree}= Is System OSTree
104+
IF ${is_ostree} Create Usr Directory Overlay
107105

108-
${stdout} ${rc}= Execute Command
109-
... ${cmd}
110-
... sudo=False return_rc=True
106+
${rc}= Execute Command
107+
... chmod 000 ${HOSTNAME_BIN_PATH}
108+
... sudo=True return_rc=True
111109
Should Be Equal As Integers 0 ${rc}
112110

113111
Restore Service

test/suites/standard2/kustomize.robot

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Resource ../../resources/common.resource
77
Resource ../../resources/systemd.resource
88
Resource ../../resources/microshift-config.resource
99
Resource ../../resources/microshift-process.resource
10+
Resource ../../resources/ostree.resource
1011
Resource ../../resources/ostree-health.resource
1112

1213
Suite Setup Setup Suite
@@ -235,13 +236,6 @@ ConfigMap Should Be Missing
235236
... shell=True
236237
Should Be Equal As Integers ${result.rc} 1
237238

238-
Create Usr Directory Overlay
239-
[Documentation] Make /usr dir writable by creating an overlay, rebooting will go back to being immutable.
240-
${stdout} ${rc}= Execute Command
241-
... rpm-ostree usroverlay
242-
... sudo=True return_rc=True
243-
Should Be Equal As Integers 0 ${rc}
244-
245239
Clear Manifest Directory
246240
[Documentation] Remove the contents of the manifest directory
247241
[Arguments] ${manifest_dir}

0 commit comments

Comments
 (0)