Skip to content

Commit 5898e18

Browse files
authored
Autorelabel is no longer required (#2828)
* Autorelabel is no longer required
1 parent 089d8f6 commit 5898e18

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

e2e/install_test.go

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -784,24 +784,16 @@ func TestSingleNodeAirgapUpgradeSelinux(t *testing.T) {
784784
},
785785
)
786786

787+
t.Logf("%s: installing policycoreutils-python-utils", time.Now().Format(time.RFC3339))
788+
if stdout, stderr, err := tc.RunCommandOnNode(0, []string{"sudo dnf makecache --refresh && sudo dnf install -y policycoreutils-python-utils"}); err != nil {
789+
t.Fatalf("fail to install policycoreutils-python-utils on node %s: %v: %s: %s", tc.Nodes[0], err, stdout, stderr)
790+
}
791+
787792
t.Logf("%s: airgapping cluster", time.Now().Format(time.RFC3339))
788793
if err := tc.Airgap(); err != nil {
789794
t.Fatalf("failed to airgap cluster: %v", err)
790795
}
791796

792-
t.Logf("%s: creating /.autorelabel file for SELinux relabeling", time.Now().Format(time.RFC3339))
793-
if stdout, stderr, err := tc.RunCommandOnNode(0, []string{"touch", "/.autorelabel"}); err != nil {
794-
t.Fatalf("fail to create /.autorelabel file on node %s: %v: %s: %s", tc.Nodes[0], err, stdout, stderr)
795-
}
796-
797-
t.Logf("%s: rebooting VM for SELinux relabeling", time.Now().Format(time.RFC3339))
798-
if stdout, stderr, err := tc.RunCommandOnNode(0, []string{"reboot"}); err != nil {
799-
t.Fatalf("fail to reboot node %s: %v: %s: %s", tc.Nodes[0], err, stdout, stderr)
800-
}
801-
802-
t.Logf("%s: waiting for node to reboot", time.Now().Format(time.RFC3339))
803-
tc.WaitForReboot()
804-
805797
t.Logf("%s: setting selinux to Enforcing mode", time.Now().Format(time.RFC3339))
806798
if stdout, stderr, err := tc.RunCommandOnNode(0, []string{"setenforce 1"}); err != nil {
807799
t.Fatalf("fail to set selinux to Enforcing mode %s: %v: %s: %s", tc.Nodes[0], err, stdout, stderr)
@@ -813,6 +805,11 @@ func TestSingleNodeAirgapUpgradeSelinux(t *testing.T) {
813805
t.Fatalf("fail to prepare airgap files on node %s: %v: %s: %s", tc.Nodes[0], err, stdout, stderr)
814806
}
815807

808+
t.Logf("%s: correcting selinux label for embedded cluster binary directory", time.Now().Format(time.RFC3339))
809+
if stdout, stderr, err := tc.RunCommandOnNode(0, []string{"sudo semanage fcontext -a -t bin_t \"/var/lib/embedded-cluster/bin(/.*)?\""}); err != nil {
810+
t.Fatalf("fail to correct selinux label for embedded cluster binary directory on node %s: %v: %s: %s", tc.Nodes[0], err, stdout, stderr)
811+
}
812+
816813
installSingleNodeWithOptions(t, tc, installOptions{
817814
isAirgap: true,
818815
version: initialVersion,

0 commit comments

Comments
 (0)