Skip to content

Commit 53e074d

Browse files
committed
sbctl: ensure tests are working with new efivarfs detection
Signed-off-by: Morten Linderud <[email protected]>
1 parent 2524baa commit 53e074d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

cmd/sbctl/status_test.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ var (
1414
)
1515

1616
func TestStatusOff(t *testing.T) {
17-
cmd := SetFS(efitest.SecureBootOff())
17+
cmd := SetFS(
18+
efitest.SecureBootOff(),
19+
efitest.SetUpModeOn(),
20+
)
1821

1922
if err := captureJsonOutput(&out, func() error {
2023
return RunStatus(cmd, []string{})
@@ -28,7 +31,8 @@ func TestStatusOff(t *testing.T) {
2831
}
2932

3033
func TestStatusOn(t *testing.T) {
31-
cmd := SetFS(efitest.SecureBootOn())
34+
cmd := SetFS(efitest.SecureBootOn(),
35+
efitest.SetUpModeOff())
3236

3337
if err := captureJsonOutput(&out, func() error {
3438
return RunStatus(cmd, []string{})
@@ -50,6 +54,7 @@ func TestFQ0001DateMethod(t *testing.T) {
5054
fstest.MapFS{"/sys/devices/virtual/dmi/id/chassis_type": {Data: []byte("3\n")}},
5155
fstest.MapFS{"/sys/devices/virtual/dmi/id/product_name": {Data: []byte("MS-7E07\n")}},
5256
efitest.SecureBootOn(),
57+
efitest.SetUpModeOff(),
5358
)
5459

5560
if err := captureJsonOutput(&out, func() error {
@@ -81,6 +86,7 @@ func TestFQ0001DeviceMethod(t *testing.T) {
8186
fstest.MapFS{"/sys/devices/virtual/dmi/id/chassis_type": {Data: []byte("3\n")}},
8287
fstest.MapFS{"/sys/devices/virtual/dmi/id/product_name": {Data: []byte("MS-7C84\n")}},
8388
efitest.SecureBootOn(),
89+
efitest.SetUpModeOff(),
8490
)
8591

8692
if err := captureJsonOutput(&out, func() error {
@@ -112,6 +118,7 @@ func TestFQ0001ExplicitlyUnaffected(t *testing.T) {
112118
fstest.MapFS{"/sys/devices/virtual/dmi/id/chassis_type": {Data: []byte("3\n")}},
113119
fstest.MapFS{"/sys/devices/virtual/dmi/id/product_name": {Data: []byte("MS-7C80\n")}},
114120
efitest.SecureBootOn(),
121+
efitest.SetUpModeOff(),
115122
)
116123

117124
if err := captureJsonOutput(&out, func() error {
@@ -141,6 +148,7 @@ func TestFQ0001WrongChassis(t *testing.T) {
141148
fstest.MapFS{"/sys/devices/virtual/dmi/id/chassis_type": {Data: []byte("5\n")}},
142149
fstest.MapFS{"/sys/devices/virtual/dmi/id/product_name": {Data: []byte("MS-7E07\n")}},
143150
efitest.SecureBootOn(),
151+
efitest.SetUpModeOff(),
144152
)
145153

146154
if err := captureJsonOutput(&out, func() error {
@@ -170,6 +178,7 @@ func TestFQ0001WrongVendor(t *testing.T) {
170178
fstest.MapFS{"/sys/devices/virtual/dmi/id/chassis_type": {Data: []byte("3\n")}},
171179
fstest.MapFS{"/sys/devices/virtual/dmi/id/product_name": {Data: []byte("MS-7E07\n")}},
172180
efitest.SecureBootOn(),
181+
efitest.SetUpModeOff(),
173182
)
174183

175184
if err := captureJsonOutput(&out, func() error {

0 commit comments

Comments
 (0)