@@ -11,40 +11,40 @@ import (
1111// TestXAttrErrorHandler tests the XAttrErrorHandler logic used in exec_binfmt.go
1212func TestXAttrErrorHandler (t * testing.T ) {
1313 tests := []struct {
14- name string
15- inputErr error
14+ name string
15+ inputErr error
1616 shouldIgnore bool
17- description string
17+ description string
1818 }{
1919 {
20- name : "ENOTSUP error should be ignored" ,
21- inputErr : syscall .ENOTSUP ,
20+ name : "ENOTSUP error should be ignored" ,
21+ inputErr : syscall .ENOTSUP ,
2222 shouldIgnore : true ,
23- description : "ENOTSUP errors occur on SELinux systems and should be ignored" ,
23+ description : "ENOTSUP errors occur on SELinux systems and should be ignored" ,
2424 },
2525 {
26- name : "errors.Is should work with wrapped ENOTSUP" ,
27- inputErr : errors .Wrap (syscall .ENOTSUP , "failed to set xattr" ),
26+ name : "errors.Is should work with wrapped ENOTSUP" ,
27+ inputErr : errors .Wrap (syscall .ENOTSUP , "failed to set xattr" ),
2828 shouldIgnore : true ,
29- description : "Wrapped ENOTSUP errors should also be ignored" ,
29+ description : "Wrapped ENOTSUP errors should also be ignored" ,
3030 },
3131 {
32- name : "EPERM error should not be ignored" ,
33- inputErr : syscall .EPERM ,
32+ name : "EPERM error should not be ignored" ,
33+ inputErr : syscall .EPERM ,
3434 shouldIgnore : false ,
35- description : "Other permission errors should be propagated" ,
35+ description : "Other permission errors should be propagated" ,
3636 },
3737 {
38- name : "EIO error should not be ignored" ,
39- inputErr : syscall .EIO ,
38+ name : "EIO error should not be ignored" ,
39+ inputErr : syscall .EIO ,
4040 shouldIgnore : false ,
41- description : "I/O errors should be propagated" ,
41+ description : "I/O errors should be propagated" ,
4242 },
4343 {
44- name : "nil error should return nil" ,
45- inputErr : nil ,
44+ name : "nil error should return nil" ,
45+ inputErr : nil ,
4646 shouldIgnore : true ,
47- description : "nil errors should return nil" ,
47+ description : "nil errors should return nil" ,
4848 },
4949 }
5050
@@ -59,7 +59,7 @@ func TestXAttrErrorHandler(t *testing.T) {
5959 }
6060
6161 result := handler ("dst" , "src" , "security.selinux" , tt .inputErr )
62-
62+
6363 if tt .shouldIgnore {
6464 require .NoError (t , result , tt .description )
6565 } else {
@@ -68,4 +68,4 @@ func TestXAttrErrorHandler(t *testing.T) {
6868 }
6969 })
7070 }
71- }
71+ }
0 commit comments