def METHOD_NAME():
    if os.system("grep NSpid /proc/self/status"):
        return
    print("Test criu-ns dump and restore in namespaces")
    def _dump():
        pid = create_isolated_dumpee()
        ret = criu_ns_dump(pid)
        if ret != 0:
            read_log_file(DUMP_LOG)
            sys.exit(ret)
    def _restore():
        ret = criu_ns_restore(restore_detached=True)
        if ret != 0:
            read_log_file(RESTORE_LOG)
            sys.exit(ret)
    def _get_restored_pid():
        restored_pid = 0
        pidfile_path = os.path.join(IMG_DIR, PIDFILE)
        if not os.path.exists(pidfile_path):
            raise FileNotFoundError("pidfile not found")
        with open(pidfile_path, "r") as pidfile:
            restored_pid = pidfile.read().strip()
        return int(restored_pid)
    def _redump():
        global IMG_DIR
        try:
            restored_pid = _get_restored_pid()
        except FileNotFoundError:
            sys.exit(1)
        IMG_DIR = "dumpdir2"
        check_dumpdir(IMG_DIR)
        ret = criu_ns_dump(restored_pid)
        if ret != 0:
            read_log_file(DUMP_LOG)
            sys.exit(ret)
    def _re_restore():
        os.unlink("running")
        ret = criu_ns_restore()
        if ret != 0:
            read_log_file(RESTORE_LOG)
            sys.exit(ret)
    check_dumpdir()
    _dump()
    _restore()
    _redump()
    _re_restore()