@@ -71,8 +71,10 @@ func (suite *SELinuxSuite) getLabel(nodeCtx context.Context, pid int32) string {
71
71
72
72
// TestFileMountLabels reads labels of runtime-created files and mounts from xattrs
73
73
// to ensure SELinux labels for files are set when they are created and FS's are mounted with correct labels.
74
- // FIXME: cancel the test in case system was upgraded.
75
74
func (suite * SELinuxSuite ) TestFileMountLabels () {
75
+ // TODO: fix system extension support
76
+ suite .T ().Skip ("skipping SELinux test while SELinux support for system extensions is not implemented" )
77
+
76
78
workers := suite .DiscoverNodeInternalIPsByType (suite .ctx , machine .TypeWorker )
77
79
controlplanes := suite .DiscoverNodeInternalIPsByType (suite .ctx , machine .TypeControlPlane )
78
80
@@ -173,30 +175,30 @@ func (suite *SELinuxSuite) checkFileLabels(nodes []string, expectedLabels map[st
173
175
return nil
174
176
}
175
177
176
- suite .Require ().NotNil (info .Xattrs )
178
+ suite .Require ().NotNil (info .Xattrs , "no xattrs for %s" , info . Name )
177
179
178
180
found := false
179
181
180
182
for _ , l := range info .Xattrs {
181
183
if l .Name == "security.selinux" {
182
184
got := string (bytes .Trim (l .Data , "\x00 \n " ))
183
- suite .Require ().Contains (got , label , "expected %s to have label %s, got %s" , path , label , got )
185
+ suite .Require ().Contains (got , label , "expected %s to have label %s, got %s" , info . Name , label , got )
184
186
185
187
found = true
186
188
187
189
break
188
190
}
189
191
}
190
192
191
- suite .Require ().True (found )
193
+ suite .Require ().True (found , "could not find security.selinux xattr for %s" , info . Name )
192
194
193
195
return nil
194
196
})
195
197
196
198
if allowMissing {
197
199
if err != nil {
198
- suite .Require ().Contains (err .Error (), "lstat" )
199
- suite .Require ().Contains (err .Error (), "no such file or directory" )
200
+ suite .Require ().Contains (err .Error (), "lstat" , "expected error to be due to missing file %s" , path )
201
+ suite .Require ().Contains (err .Error (), "no such file or directory" , "expected error to be due to missing file %s" , path )
200
202
}
201
203
} else {
202
204
suite .Require ().NoError (err )
0 commit comments