forked from rhboot/shim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-mok-mirror.c
700 lines (631 loc) · 17.3 KB
/
test-mok-mirror.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
// SPDX-License-Identifier: BSD-2-Clause-Patent
/*
* test-mok-mirror.c - try to test our mok mirroring code
* Copyright Peter Jones <[email protected]>
*/
#include "shim.h"
#include "mock-variables.h"
#include "test-data-efivars-1.h"
#include <stdio.h>
#pragma GCC diagnostic ignored "-Wunused-parameter"
EFI_STATUS
start_image(EFI_HANDLE image_handle UNUSED, CHAR16 *mm)
{
printf("Attempted to launch %s\n", Str2str(mm));
return EFI_SUCCESS;
}
#define N_TEST_VAR_OPS 40
struct test_var {
/*
* The GUID, name, and attributes of the variables
*/
EFI_GUID guid;
CHAR16 *name;
UINT32 attrs;
/*
* If the variable is required to be present, with the attributes
* specified above, for a test to pass
*/
bool must_be_present;
/*
* If the variable is required to be absent, no matter what the
* attributes, for a test to pass
*/
bool must_be_absent;
/*
* The number of operations on this variable that we've seen
*/
UINTN n_ops;
/*
* the operations that have occurred on this variable
*/
mock_variable_op_t ops[N_TEST_VAR_OPS];
/*
* the result codes of those operations
*/
EFI_STATUS results[N_TEST_VAR_OPS];
};
static struct test_var *test_vars;
struct mock_mok_variable_config_entry {
/*
* The name of an entry we expect to see in the MokVars
* configuration table
*/
CHAR8 name[256];
/*
* The size of its data
*/
UINT64 data_size;
/*
* A pointer to what the data should be
*/
const unsigned char *data;
};
static void
setvar_post(CHAR16 *name, EFI_GUID *guid, UINT32 attrs,
UINTN size, VOID *data, EFI_STATUS *status,
mock_variable_op_t op, const char * const file,
const int line, const char * const func)
{
if (!test_vars)
return;
for (UINTN i = 0; test_vars[i].name != NULL; i++) {
struct test_var *tv = &test_vars[i];
if (CompareGuid(&tv->guid, guid) != 0 ||
StrCmp(tv->name, name) != 0)
continue;
tv->ops[tv->n_ops] = op;
tv->results[tv->n_ops] = *status;
tv->n_ops += 1;
}
}
static void
getvar_post(CHAR16 *name, EFI_GUID *guid,
UINT32 *attrs, UINTN *size,
VOID *data, EFI_STATUS *status,
const char * const file, const int line, const char * func)
{
if (EFI_ERROR(*status) &&
(*status != EFI_NOT_FOUND &&
*status != EFI_BUFFER_TOO_SMALL)) {
printf("%s:%d:%s():Getting "GUID_FMT"-%s ",
file, line, func,
GUID_ARGS(*guid), Str2str(name));
if (attrs)
printf("attrs:%s\n", format_var_attrs(*attrs));
else
printf("attrs:NULL\n");
printf("failed:%s\n", efi_strerror(*status));
}
if (!test_vars)
return;
for (UINTN i = 0; test_vars[i].name != NULL; i++) {
struct test_var *tv = &test_vars[i];
if (CompareGuid(&tv->guid, guid) != 0 ||
StrCmp(tv->name, name) != 0)
continue;
tv->ops[tv->n_ops] = GET;
tv->results[tv->n_ops] = *status;
tv->n_ops += 1;
}
}
static EFI_STATUS
check_variables(struct test_var *vars)
{
for (size_t i = 0; vars[i].name != NULL; i++) {
struct test_var *tv = &vars[i];
list_t *pos = NULL;
bool found = false;
char buf[1];
UINTN size = 0;
UINT32 attrs = 0;
bool present = false;
list_for_each(pos, &mock_variables) {
struct mock_variable *var;
bool deleted;
bool created;
int gets = 0;
var = list_entry(pos, struct mock_variable, list);
if (CompareGuid(&tv->guid, &var->guid) != 0 ||
StrCmp(var->name, tv->name) != 0)
continue;
found = true;
assert_equal_goto(var->attrs, tv->attrs, err,
"\"%s\": wrong attrs; got %s expected %s\n",
Str2str(tv->name),
format_var_attrs(var->attrs),
format_var_attrs(tv->attrs));
for (UINTN j = 0; j < N_TEST_VAR_OPS
&& tv->ops[j] != NONE; j++) {
switch (tv->ops[j]) {
case NONE:
default:
break;
case CREATE:
if (tv->results[j] == EFI_SUCCESS)
created = true;
break;
case DELETE:
assert_goto(tv->results[j] != EFI_SUCCESS, err,
"Tried to delete absent variable \"%s\"\n",
Str2str(tv->name));
assert_goto(created == false, err,
"Deleted variable \"%s\" was previously created.\n",
Str2str(tv->name));
break;
case APPEND:
assert_goto(false, err,
"No append action should have been tested\n");
break;
case REPLACE:
assert_goto(false, err,
"No replace action should have been tested\n");
break;
case GET:
if (tv->results[j] == EFI_SUCCESS)
gets += 1;
break;
}
}
assert_goto(gets == 0 || gets == 1, err,
"Variable should not be read %d times.\n", gets);
}
if (tv->must_be_present) {
/*
* This asserts if it isn't present, and if that's
* the case, then the attributes are already
* validated in the search loop
*/
assert_goto(found == true, err,
"variable \"%s\" was not found.\n",
Str2str(tv->name));
}
if (tv->must_be_absent) {
/*
* deliberately does not check the attributes at
* this time.
*/
assert_goto(found == false, err,
"variable \"%s\" was found.\n",
Str2str(tv->name));
}
}
return EFI_SUCCESS;
err:
return EFI_INVALID_PARAMETER;
}
static EFI_STATUS
check_config_table(struct mock_mok_variable_config_entry *test_configs,
uint8_t *config_pos)
{
size_t i = 0;
while (config_pos) {
struct mock_mok_variable_config_entry *mock_entry =
&test_configs[i];
struct mok_variable_config_entry *mok_entry =
(struct mok_variable_config_entry *)config_pos;
/*
* If the tables are different lengths, this will trigger.
*/
assert_equal_goto(mok_entry->name[0], mock_entry->name[0], err,
"mok.name[0] %ld != test.name[0] %ld\n");
if (mock_entry->name[0] == 0)
break;
assert_nonzero_goto(mok_entry->name[0], err, "%ld != %ld\n");
assert_zero_goto(strncmp(mok_entry->name, mock_entry->name,
sizeof(mock_entry->name)),
err, "%ld != %ld: strcmp(\"%s\",\"%s\")\n",
mok_entry->name, mock_entry->name);
/*
* As of 7501b6bb449f ("mok: fix potential buffer overrun in
* import_mok_state"), we should not see any mok config
* variables with data_size == 0.
*/
assert_nonzero_goto(mok_entry->data_size, err, "%ld != 0\n");
assert_equal_goto(mok_entry->data_size, mock_entry->data_size,
err, "%ld != %ld\n");
assert_zero_goto(CompareMem(mok_entry->data, mock_entry->data,
mok_entry->data_size),
err, "%ld != %ld\n");
config_pos += offsetof(struct mok_variable_config_entry, data)
+ mok_entry->data_size;
i += 1;
}
return EFI_SUCCESS;
err:
return EFI_INVALID_PARAMETER;
}
static int
test_mok_mirror(struct test_var *vars,
struct mock_mok_variable_config_entry *configs,
EFI_STATUS expected_status)
{
EFI_STATUS status;
EFI_GUID mok_config_guid = MOK_VARIABLE_STORE;
int ret = -1;
status = import_mok_state(NULL);
assert_equal_goto(status, expected_status, err,
"got 0x%016lx, expected 0x%016lx\n",
expected_status);
test_vars = vars;
status = check_variables(vars);
if (EFI_ERROR(status))
goto err;
uint8_t *pos = NULL;
for (size_t i = 0; i < ST->NumberOfTableEntries; i++) {
EFI_CONFIGURATION_TABLE *ct = &ST->ConfigurationTable[i];
if (CompareGuid(&ct->VendorGuid, &mok_config_guid) != 0)
continue;
pos = (void *)ct->VendorTable;
break;
}
assert_nonzero_goto(pos, err, "%p != 0\n");
status = check_config_table(configs, pos);
if (EFI_ERROR(status))
goto err;
ret = 0;
err:
for (UINTN k = 0; k < n_mok_state_variables; k++) {
struct mok_state_variable *v =
&mok_state_variables[k];
if (v->data_size && v->data) {
free(v->data);
v->data = NULL;
v->data_size = 0;
}
}
test_vars = NULL;
return ret;
}
/*
* This tests mirroring of mok variables on fairly optimistic conditions:
* there's enough space for everything, and so we expect to see all the
* RT variables for which we have data mirrored
*/
static int
test_mok_mirror_with_enough_space(void)
{
const char *mok_rt_vars[n_mok_state_variables];
EFI_STATUS status;
EFI_GUID guid = SHIM_LOCK_GUID;
int ret = -1;
struct test_var test_mok_mirror_with_enough_space_vars[] = {
{.guid = SHIM_LOCK_GUID,
.name = L"MokList",
.must_be_present = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_NON_VOLATILE,
.ops = { NONE, },
},
{.guid = SHIM_LOCK_GUID,
.name = L"MokListRT",
.must_be_present = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
.ops = { NONE, },
},
{.guid = SHIM_LOCK_GUID,
.name = L"MokListX",
.must_be_present = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_NON_VOLATILE,
.ops = { NONE, },
},
{.guid = SHIM_LOCK_GUID,
.name = L"MokListXRT",
.must_be_present = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
.ops = { NONE, },
},
{.guid = SHIM_LOCK_GUID,
.name = L"SbatLevel",
.must_be_present = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_NON_VOLATILE,
.ops = { NONE, },
},
{.guid = SHIM_LOCK_GUID,
.name = L"SbatLevelRT",
.must_be_present = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
.ops = { NONE, },
},
{.guid = SHIM_LOCK_GUID,
.name = L"MokIgnoreDB",
.must_be_absent = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
.ops = { NONE, },
},
{.guid = SHIM_LOCK_GUID,
.name = L"MokSBState",
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_NON_VOLATILE,
.ops = { NONE, },
},
{.guid = SHIM_LOCK_GUID,
.name = L"MokSBStateRT",
.must_be_absent = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
.ops = { NONE, },
},
{.guid = { 0, },
.name = NULL,
}
};
/*
* We must see the supplied values of MokListRT, MokListXRT, and
* SbatLevelRT in the config table
*/
struct mock_mok_variable_config_entry test_mok_config_table[] = {
{.name = "MokListRT",
.data_size = sizeof(test_data_efivars_1_MokListRT),
.data = test_data_efivars_1_MokListRT
},
{.name = "MokListXRT",
.data_size = sizeof(test_data_efivars_1_MokListXRT),
.data = test_data_efivars_1_MokListXRT
},
{.name = "SbatLevelRT",
.data_size = sizeof(test_data_efivars_1_SbatLevelRT),
.data = test_data_efivars_1_SbatLevelRT
},
{.name = "MokListTrustedRT",
.data_size = sizeof(test_data_efivars_1_MokListTrustedRT),
.data = test_data_efivars_1_MokListTrustedRT
},
{.name = { 0, },
.data_size = 0,
.data = NULL,
}
};
for (size_t i = 0; i < n_mok_state_variables; i++) {
mok_rt_vars[i] = mok_state_variables[i].rtname8;
}
mock_load_variables("test-data/efivars-1", mok_rt_vars, true);
mock_set_variable_post_hook = setvar_post;
mock_get_variable_post_hook = getvar_post;
ret = test_mok_mirror(&test_mok_mirror_with_enough_space_vars[0],
test_mok_config_table,
EFI_SUCCESS);
mock_set_variable_post_hook = NULL;
mock_get_variable_post_hook = NULL;
return ret;
}
static int
test_mok_mirror_setvar_out_of_resources(void)
{
const char *mok_rt_vars[n_mok_state_variables];
EFI_STATUS status;
EFI_GUID guid = SHIM_LOCK_GUID;
EFI_GUID mok_config_guid = MOK_VARIABLE_STORE;
int ret = -1;
/*
* These sizes are picked specifically so that MokListRT will fail
* to get mirrored with the test data in test-data/efivars-1
*/
list_t mock_obnoxious_variable_limits;
UINT64 obnoxious_max_var_storage = 0xffe4;
UINT64 obnoxious_remaining_var_storage = 919+0x3c;
UINT64 obnoxious_max_var_size = 919;
struct mock_variable_limits obnoxious_limits[] = {
{.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS,
.max_var_storage = &obnoxious_max_var_storage,
.remaining_var_storage = &obnoxious_remaining_var_storage,
.max_var_size = &obnoxious_max_var_size,
.status = EFI_SUCCESS,
},
{.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
.max_var_storage = &obnoxious_max_var_storage,
.remaining_var_storage = &obnoxious_remaining_var_storage,
.max_var_size = &obnoxious_max_var_size,
.status = EFI_SUCCESS,
},
{.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_NON_VOLATILE,
.max_var_storage = &obnoxious_max_var_storage,
.remaining_var_storage = &obnoxious_remaining_var_storage,
.max_var_size = &obnoxious_max_var_size,
.status = EFI_SUCCESS,
},
{.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS |
EFI_VARIABLE_NON_VOLATILE,
.max_var_storage = &obnoxious_max_var_storage,
.remaining_var_storage = &obnoxious_remaining_var_storage,
.max_var_size = &obnoxious_max_var_size,
.status = EFI_SUCCESS,
},
{.attrs = 0, }
};
struct test_var test_mok_mirror_enospc_vars[] = {
/*
* We must to see a BS|NV MokList
*/
{.guid = SHIM_LOCK_GUID,
.name = L"MokList",
.must_be_present = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_NON_VOLATILE,
.ops = { NONE, },
},
/*
* We must *NOT* see a BS|RT MokListRT
*/
{.guid = SHIM_LOCK_GUID,
.name = L"MokListRT",
.must_be_absent = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
.ops = { NONE, },
},
/*
* We must see a BS|NV MokListX
*/
{.guid = SHIM_LOCK_GUID,
.name = L"MokListX",
.must_be_present = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_NON_VOLATILE,
.ops = { NONE, },
},
/*
* We must see a BS|RT MokListXRT
*/
{.guid = SHIM_LOCK_GUID,
.name = L"MokListXRT",
.must_be_present = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
.ops = { NONE, },
},
/*
* We must see a BS|NV SbatLevel
*/
{.guid = SHIM_LOCK_GUID,
.name = L"SbatLevel",
.must_be_present = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_NON_VOLATILE,
.ops = { NONE, },
},
/*
* We must see a BS|RT SbatLevelRT
*/
{.guid = SHIM_LOCK_GUID,
.name = L"SbatLevelRT",
.must_be_present = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
.ops = { NONE, },
},
/*
* We must not see a MokIgnoreDB
*/
{.guid = SHIM_LOCK_GUID,
.name = L"MokIgnoreDB",
.must_be_absent = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
.ops = { NONE, },
},
/*
* We must not see MokSBState
*/
{.guid = SHIM_LOCK_GUID,
.name = L"MokSBState",
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_NON_VOLATILE,
.ops = { NONE, },
},
/*
* We must not see MokSBStateRT
*/
{.guid = SHIM_LOCK_GUID,
.name = L"MokSBStateRT",
.must_be_absent = true,
.attrs = EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
.ops = { NONE, },
},
{.guid = { 0, },
.name = NULL,
}
};
/*
* We must see the supplied values of MokListRT, MokListXRT, and
* SbatLevelRT in the config table
*/
struct mock_mok_variable_config_entry test_mok_config_table[] = {
{.name = "MokListRT",
.data_size = sizeof(test_data_efivars_1_MokListRT),
.data = test_data_efivars_1_MokListRT
},
{.name = "MokListXRT",
.data_size = sizeof(test_data_efivars_1_MokListXRT),
.data = test_data_efivars_1_MokListXRT
},
{.name = "SbatLevelRT",
.data_size = sizeof(test_data_efivars_1_SbatLevelRT),
.data = test_data_efivars_1_SbatLevelRT
},
{.name = "MokListTrustedRT",
.data_size = sizeof(test_data_efivars_1_MokListTrustedRT),
.data = test_data_efivars_1_MokListTrustedRT
},
{.name = { 0, },
.data_size = 0,
.data = NULL,
}
};
UINT64 max_storage_sz = 0;
UINT64 max_var_sz = 0;
UINT64 remaining_sz = 0;
for (size_t i = 0; i < n_mok_state_variables; i++) {
mok_rt_vars[i] = mok_state_variables[i].rtname8;
}
mock_load_variables("test-data/efivars-1", mok_rt_vars, true);
mock_set_variable_post_hook = setvar_post;
mock_get_variable_post_hook = getvar_post;
mock_set_usage_limits(&mock_obnoxious_variable_limits,
&obnoxious_limits[0]);
ret = test_mok_mirror(&test_mok_mirror_enospc_vars[0],
test_mok_config_table,
EFI_OUT_OF_RESOURCES);
mock_set_default_usage_limits();
mock_set_variable_post_hook = NULL;
mock_get_variable_post_hook = NULL;
return ret;
}
int
main(void)
{
int status = 0;
setbuf(stdout, NULL);
const char *sort_policy_names[] = {
"MOCK_SORT_DESCENDING",
"MOCK_SORT_PREPEND",
"MOCK_SORT_APPEND",
"MOCK_SORT_ASCENDING",
"MOCK_SORT_MAX_SENTINEL"
};
const char *del_policy_names[] = {
"MOCK_VAR_DELETE_ATTR_ALLOW_ZERO",
"MOCK_VAR_DELETE_ATTR_ALOW_MISMATCH",
"MOCK_VAR_DELETE_ATTR_ALLOW_ZERO|MOCK_VAR_DELETE_ATTR_ALOW_MISMATCH",
"MOCK_VAR_DELETE_ATTR_ALLOW_NONE",
NULL
};
int delete_policies[] = {
MOCK_VAR_DELETE_ATTR_ALLOW_ZERO,
MOCK_VAR_DELETE_ATTR_ALOW_MISMATCH,
MOCK_VAR_DELETE_ATTR_ALLOW_ZERO
| MOCK_VAR_DELETE_ATTR_ALOW_MISMATCH,
0
};
for (int i = 0; i < MOCK_SORT_MAX_SENTINEL; i++) {
mock_variable_sort_policy = i;
mock_config_table_sort_policy = i;
int j = 0;
printf("%s: setting variable sort policy to %s\n",
program_invocation_short_name, sort_policy_names[i]);
do {
printf("%s: setting delete policy to %s\n",
program_invocation_short_name,
del_policy_names[j]);
mock_variable_delete_attr_policy = delete_policies[j];
test(test_mok_mirror_with_enough_space);
mock_finalize_vars_and_configs();
test(test_mok_mirror_setvar_out_of_resources);
mock_finalize_vars_and_configs();
if (delete_policies[j] == 0)
break;
} while (++j);
}
return status;
}
// vim:fenc=utf-8:tw=75:noet