mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 18:25:14 +00:00
This option cannot be tested using classic zdtm tests as it implies some data created before restore and passed through criu restore down to the restored process (descriptor in our case). So add inhfd_test class that creates such. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
15 lines
358 B
Python
Executable file
15 lines
358 B
Python
Executable file
import socket
|
|
import os
|
|
|
|
def create_fds():
|
|
(sk1, sk2) = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
return (sk1.makefile("w"), sk2.makefile("r"))
|
|
|
|
def __sock_ino(sockf):
|
|
return os.fstat(sockf.fileno()).st_ino
|
|
|
|
def filename(sockf):
|
|
return 'socket:[%d]' % __sock_ino(sockf)
|
|
|
|
def dump_opts(sockf):
|
|
return ['--ext-unix-sk=%d' % __sock_ino(sockf)]
|