Skip to content

Commit

Permalink
fault: allow to check dont_use_freeze_cgroup
Browse files Browse the repository at this point in the history
Adds a new "fault" to call dont_use_freeze_cgroup.
  • Loading branch information
avagin committed Sep 13, 2024
1 parent 2a51b4d commit 895a7a7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions criu/fault-injection.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <stdlib.h>
#include "criu-log.h"
#include "fault-injection.h"
#include "seize.h"

enum faults fi_strategy;

Expand All @@ -21,5 +22,13 @@ int fault_injection_init(void)
}

fi_strategy = start;

switch (fi_strategy) {
case FI_DISABLE_FREEZE_CGROUP:
dont_use_freeze_cgroup();
break;
default:
break;
};
return 0;
}
1 change: 1 addition & 0 deletions criu/include/fault-injection.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ enum faults {
FI_CORRUPT_EXTREGS = 134,
FI_DONT_USE_PAGEMAP_SCAN = 135,
FI_DUMP_CRASH = 136,
FI_DISABLE_FREEZE_CGROUP = 137,
FI_MAX,
};

Expand Down
1 change: 1 addition & 0 deletions criu/include/seize.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define __CR_SEIZE_H__

extern int collect_pstree(void);
struct pstree_item;
extern void pstree_switch_state(struct pstree_item *root_item, int st);
extern const char *get_real_freezer_state(void);
extern bool alarm_timeouted(void);
Expand Down
4 changes: 4 additions & 0 deletions test/jenkins/criu-fault.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ fi
# also check for the main thread corruption
./test/zdtm.py run -t zdtm/static/fpu00 --fault 134 -f h --norst || fail

# check dont_use_freeze_cgroup
./test/zdtm.py run -t zdtm/static/env00 --freezecg zdtm:t --fault 137
./test/zdtm.py run -t zdtm/static/env00 --freezecg zdtm:t --fault 137 --norst

if ./test/zdtm.py run -t zdtm/static/vfork00 --fault 136 --report report -f h ; then
fail
fi

0 comments on commit 895a7a7

Please sign in to comment.