def METHOD_NAME():
    print("Test criu-ns dump and restore with --shell-job option")
    check_dumpdir()
    pathlib.Path("running").touch()
    pid = os.fork()
    if pid == 0:
        while True:
            if not os.access("running", os.F_OK):
                sys.exit(0)
            time.sleep(1)
    ret = criu_ns_dump(pid, shell_job=True)
    if ret != 0:
        read_log_file(DUMP_LOG)
        sys.exit(ret)
    os.unlink("running")
    fd_m, fd_s = create_pty()
    pid = os.fork()
    if pid == 0:
        os.setsid()
        fd_m.close()
        # since criu-ns takes control of the tty stdin
        os.dup2(fd_s.fileno(), 0)
        ret = criu_ns_restore(shell_job=True)
        if ret != 0:
            read_log_file(RESTORE_LOG)
            sys.exit(ret)
        os._exit(0)
    fd_s.close()
    os.waitpid(pid, 0)