Make the cgroup freezer and do_ckpt() no-ops in order to do dry-runs of the tests. This allows us to establish a baseline for those tests that can do dry-runsi (i.e. have a dry-run option and use it to avoid restarting checkpoint images). Signed-off-by: Matt Helsley <matthltc@xxxxxxxxxx> --- libcrtest/common.c | 17 ++++++++++++++--- libcrtest/libcrtest.h | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/libcrtest/common.c b/libcrtest/common.c index 6cfc9a9..c496889 100644 --- a/libcrtest/common.c +++ b/libcrtest/common.c @@ -42,6 +42,9 @@ int test_checkpoint_done(void) { int rc; + rc = access(CKPT_DRY_RUN, F_OK); + if (rc == 0) + return 1; rc = access(CKPT_DONE, F_OK); if (rc == 0) return 1; @@ -57,8 +60,11 @@ int test_checkpoint_done(void) void set_checkpoint_ready() { - int fd; + int fd, rc; + rc = access(CKPT_DRY_RUN, F_OK); + if (rc == 0) + return; fd = creat(CKPT_READY, 0666); if (fd < 0) { fprintf(logfp, "creat(%s) failed, %s\n", CKPT_READY, @@ -75,7 +81,7 @@ void do_ckpt(void) set_checkpoint_ready(); - rc = access(CKPT_SKIP, F_OK); + rc = access(CKPT_DRY_RUN, F_OK); if (rc == 0) return; else if (errno != ENOENT) @@ -340,9 +346,14 @@ static void create_cgroup(char *grp) */ int move_to_cgroup(char *subsys, char *grp, int pid) { + char fname[MAXPATH]; + int rc; + + rc = access(CKPT_DRY_RUN, F_OK); + if (rc == 0) + return 1; if (strcmp(subsys, "freezer")) return 0; - char fname[MAXPATH]; if (!freezer_mountpoint()) { printf("freezer cgroup is not mounted.\n"); do_exit(1); diff --git a/libcrtest/libcrtest.h b/libcrtest/libcrtest.h index 7f8cfff..9723c74 100644 --- a/libcrtest/libcrtest.h +++ b/libcrtest/libcrtest.h @@ -3,7 +3,7 @@ #define CKPT_READY "checkpoint-ready" #define CKPT_DONE "checkpoint-done" -#define CKPT_SKIP "checkpoint-skip" +#define CKPT_DRY_RUN "checkpoint-skip" #define TEST_DONE "test-done" extern FILE *logfp; -- 1.6.3.3 _______________________________________________ Containers mailing list Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/containers