[CRIU] test for external mounts

Tycho Andersen tycho.andersen at canonical.com
Tue Apr 21 08:21:22 PDT 2015


Hi Pavel,

On Tue, Apr 21, 2015 at 02:41:18PM +0300, Pavel Emelyanov wrote:
> On 04/17/2015 11:34 PM, Tycho Andersen wrote:
> > Hi all,
> > 
> > I'm having a problem getting my test for external sharing to work
> > correctly. The patch is attached, and when I run it I get:
> > 
> > sudo ./zdtm.sh -r ns/static/external_shared_mounts
> > Execute ns/static/external_shared_mounts
> > mkdir: cannot create directory ‘/tmp/criu-root.utSwRv/dev’: File exists
> > mknod: ‘/tmp/criu-root.utSwRv/dev/tty’: File exists
> > ./external_shared_mounts --pidfile=external_shared_mounts.pid --outfile=external_shared_mounts.out --dirname=external_shared_mounts.test
> > /home/ubuntu/criu/test
> > Dump 2644
> > Restore
> > Test: zdtm/live/static/external_shared_mounts, Result: FAIL
> > ==================================== ERROR ====================================
> > Test: zdtm/live/static/external_shared_mounts, Namespace: 1
> > Dump log   : /home/ubuntu/criu/test/dump/ns/static/external_shared_mounts/2644/1/dump.log
> > --------------------------------- grep Error ---------------------------------
> > ------------------------------------- END -------------------------------------
> > Restore log: /home/ubuntu/criu/test/dump/ns/static/external_shared_mounts/2644/1/restore.log
> > --------------------------------- grep Error ---------------------------------
> > (00.007393)      1: Error (mount.c:276): Mountpoint 84 w/o parent 83 found @.criu.mntns.aDwkKj/12/ (root found)
> 
> The mountpoint 84 from the image doesn't have the parent (83) in the image.
> Can you check what's there in the images with mountpoints? The crit decode -i mountpoints-$id.img --pretty does this.

Yes, see below. The child process (12) is the one I actually care about
dumping, and the parent (11) I guess is the process criu is invoked from?

Tycho

~/criu/crit decode -i mountpoints-11.img --pretty
{
    "magic": "MNTS", 
    "entries": [
        {
            "shared_id": 0, 
            "parent_mnt_id": 84, 
            "root_dev": 265289729, 
            "fstype": 0, 
            "source": "/dev/disk/by-uuid/6c5a78e0-95fa-49a8-aa91-a8093d295e58", 
            "flags": "0x280000", 
            "mountpoint": "/zdtm/live/static/external_shared_mounts.test/bind3", 
            "master_id": 31, 
            "root": "/home/ubuntu/criu/test/zdtm/live/static/external_shared_mounts.test/bind1", 
            "options": "data=ordered", 
            "mnt_id": 52
        }, 
        {
            "shared_id": 31, 
            "ext_mount": true, 
            "parent_mnt_id": 84, 
            "root_dev": 265289729, 
            "fstype": 0, 
            "source": "//home/ubuntu/criu/test/zdtm/live/static/external_shared_mounts.test/bind1", 
            "flags": "0x300000", 
            "internal_sharing": true, 
            "mountpoint": "/zdtm/live/static/external_shared_mounts.test/bind2", 
            "master_id": 0, 
            "root": "CRIU:AUTOGENERATED", 
            "options": "data=ordered", 
            "mnt_id": 51
        }, 
        {
            "shared_id": 0, 
            "parent_mnt_id": 84, 
            "root_dev": 40, 
            "fstype": 6, 
            "source": "pts", 
            "flags": "0x200000", 
            "mountpoint": "/dev/pts", 
            "master_id": 0, 
            "root": "/", 
            "options": "mode=666,ptmxmode=666,newinstance", 
            "mnt_id": 50
        }, 
        {
            "shared_id": 0, 
            "parent_mnt_id": 84, 
            "root_dev": 39, 
            "fstype": 1, 
            "source": "proc", 
            "flags": "0x200000", 
            "mountpoint": "/proc", 
            "master_id": 0, 
            "root": "/", 
            "options": "", 
            "mnt_id": 86
        }, 
        {
            "shared_id": 0, 
            "parent_mnt_id": 49, 
            "root_dev": 265289729, 
            "fstype": 0, 
            "source": "/dev/disk/by-uuid/6c5a78e0-95fa-49a8-aa91-a8093d295e58", 
            "flags": "0x200000", 
            "mountpoint": "/", 
            "master_id": 0, 
            "root": "/home/ubuntu/criu/test", 
            "options": "data=ordered", 
            "mnt_id": 84
        }
    ]
}

~/criu/crit decode -i mountpoints-12.img --pretty
{
    "magic": "MNTS", 
    "entries": [
        {
            "shared_id": 0, 
            "parent_mnt_id": 54, 
            "root_dev": 265289729, 
            "fstype": 0, 
            "source": "/dev/disk/by-uuid/6c5a78e0-95fa-49a8-aa91-a8093d295e58", 
            "flags": "0x280000", 
            "mountpoint": "/zdtm/live/static/external_shared_mounts.test/bind3", 
            "master_id": 31, 
            "root": "/home/ubuntu/criu/test/zdtm/live/static/external_shared_mounts.test/bind1", 
            "options": "data=ordered", 
            "mnt_id": 58
        }, 
        {
            "shared_id": 0, 
            "parent_mnt_id": 54, 
            "root_dev": 40, 
            "fstype": 6, 
            "source": "pts", 
            "flags": "0x200000", 
            "mountpoint": "/dev/pts", 
            "master_id": 0, 
            "root": "/", 
            "options": "mode=666,ptmxmode=666,newinstance", 
            "mnt_id": 56
        }, 
        {
            "shared_id": 0, 
            "parent_mnt_id": 54, 
            "root_dev": 39, 
            "fstype": 1, 
            "source": "proc", 
            "flags": "0x200000", 
            "mountpoint": "/proc", 
            "master_id": 0, 
            "root": "/", 
            "options": "", 
            "mnt_id": 55
        }, 
        {
            "shared_id": 0, 
            "parent_mnt_id": 53, 
            "root_dev": 265289729, 
            "fstype": 0, 
            "source": "/dev/disk/by-uuid/6c5a78e0-95fa-49a8-aa91-a8093d295e58", 
            "flags": "0x200000", 
            "mountpoint": "/", 
            "master_id": 0, 
            "root": "/home/ubuntu/criu/test", 
            "options": "data=ordered", 
            "mnt_id": 54
        }
    ]
}


More information about the CRIU mailing list