Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- src/libvirt_private.syms | 1 + src/util/vircgroup.c | 19 ++-- src/util/vircgrouppriv.h | 4 + tests/vircgroupdata/all-in-one.mounts | 7 ++ tests/vircgroupdata/all-in-one.parsed | 10 +++ tests/vircgroupdata/cgroups1.mounts | 30 +++++++ tests/vircgroupdata/cgroups1.parsed | 10 +++ tests/vircgroupdata/cgroups2.mounts | 22 +++++ tests/vircgroupdata/cgroups2.parsed | 10 +++ tests/vircgroupdata/cgroups3.mounts | 28 ++++++ tests/vircgroupdata/cgroups3.parsed | 10 +++ tests/vircgroupdata/fedora-18.mounts | 30 +++++++ tests/vircgroupdata/fedora-18.parsed | 10 +++ tests/vircgroupdata/fedora-21.mounts | 33 +++++++ tests/vircgroupdata/fedora-21.parsed | 10 +++ tests/vircgroupdata/no-cgroups.mounts | 10 +++ tests/vircgroupdata/no-cgroups.parsed | 10 +++ tests/vircgroupdata/ovirt-node-6.6.mounts | 144 ++++++++++++++++++++++++++++++ tests/vircgroupdata/ovirt-node-6.6.parsed | 10 +++ tests/vircgroupdata/ovirt-node-7.1.mounts | 142 +++++++++++++++++++++++++++++ tests/vircgroupdata/ovirt-node-7.1.parsed | 10 +++ tests/vircgroupdata/rhel-7.1.mounts | 31 +++++++ tests/vircgroupdata/rhel-7.1.parsed | 10 +++ tests/vircgrouptest.c | 71 +++++++++++++++ 24 files changed, 666 insertions(+), 6 deletions(-) create mode 100644 tests/vircgroupdata/all-in-one.mounts create mode 100644 tests/vircgroupdata/all-in-one.parsed create mode 100644 tests/vircgroupdata/cgroups1.mounts create mode 100644 tests/vircgroupdata/cgroups1.parsed create mode 100644 tests/vircgroupdata/cgroups2.mounts create mode 100644 tests/vircgroupdata/cgroups2.parsed create mode 100644 tests/vircgroupdata/cgroups3.mounts create mode 100644 tests/vircgroupdata/cgroups3.parsed create mode 100644 tests/vircgroupdata/fedora-18.mounts create mode 100644 tests/vircgroupdata/fedora-18.parsed create mode 100644 tests/vircgroupdata/fedora-21.mounts create mode 100644 tests/vircgroupdata/fedora-21.parsed create mode 100644 tests/vircgroupdata/no-cgroups.mounts create mode 100644 tests/vircgroupdata/no-cgroups.parsed create mode 100644 tests/vircgroupdata/ovirt-node-6.6.mounts create mode 100644 tests/vircgroupdata/ovirt-node-6.6.parsed create mode 100644 tests/vircgroupdata/ovirt-node-7.1.mounts create mode 100644 tests/vircgroupdata/ovirt-node-7.1.parsed create mode 100644 tests/vircgroupdata/rhel-7.1.mounts create mode 100644 tests/vircgroupdata/rhel-7.1.parsed diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 1fb42ac..ca27af4 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1126,6 +1126,7 @@ virCgroupDenyAllDevices; virCgroupDenyDevice; virCgroupDenyDeviceMajor; virCgroupDenyDevicePath; +virCgroupDetectMountsFromFile; virCgroupFree; virCgroupGetBlkioIoDeviceServiced; virCgroupGetBlkioIoServiced; diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index e54a079..5c392ac 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -338,18 +338,19 @@ virCgroupCopyMounts(virCgroupPtr group, * Process /proc/mounts figuring out what controllers are * mounted and where */ -static int -virCgroupDetectMounts(virCgroupPtr group) +int +virCgroupDetectMountsFromFile(virCgroupPtr group, + const char *path, + bool checkLinks) { size_t i; FILE *mounts = NULL; struct mntent entry; char buf[CGROUP_MAX_VAL]; - mounts = fopen("/proc/mounts", "r"); + mounts = fopen(path, "r"); if (mounts == NULL) { - virReportSystemError(errno, "%s", - _("Unable to open /proc/mounts")); + virReportSystemError(errno, _("Unable to open %s"), path); return -1; } @@ -394,7 +395,7 @@ virCgroupDetectMounts(virCgroupPtr group) /* If it is a co-mount it has a filename like "cpu,cpuacct" * and we must identify the symlink path */ - if (strchr(tmp2 + 1, ',')) { + if (checkLinks && strchr(tmp2 + 1, ',')) { *tmp2 = '\0'; if (virAsprintf(&linksrc, "%s/%s", entry.mnt_dir, typestr) < 0) @@ -436,6 +437,12 @@ virCgroupDetectMounts(virCgroupPtr group) return -1; } +static int +virCgroupDetectMounts(virCgroupPtr group) +{ + return virCgroupDetectMountsFromFile(group, "/proc/mounts", true); +} + static int virCgroupCopyPlacement(virCgroupPtr group, diff --git a/src/util/vircgrouppriv.h b/src/util/vircgrouppriv.h index 582be79..722863e 100644 --- a/src/util/vircgrouppriv.h +++ b/src/util/vircgrouppriv.h @@ -48,4 +48,8 @@ struct virCgroup { struct virCgroupController controllers[VIR_CGROUP_CONTROLLER_LAST]; }; +int virCgroupDetectMountsFromFile(virCgroupPtr group, + const char *path, + bool checkLinks); + #endif /* __VIR_CGROUP_PRIV_H__ */ diff --git a/tests/vircgroupdata/all-in-one.mounts b/tests/vircgroupdata/all-in-one.mounts new file mode 100644 index 0000000..14093b9 --- /dev/null +++ b/tests/vircgroupdata/all-in-one.mounts @@ -0,0 +1,7 @@ +rootfs / rootfs rw 0 0 +sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 +proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 +udev /dev devtmpfs rw,relatime,size=16458560k,nr_inodes=4114640,mode=755 0 0 +devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 +nfsd /proc/fs/nfsd nfsd rw,relatime 0 0 +cgroup /sys/fs/cgroup cgroup rw,relatime,blkio,devices,memory,cpuacct,cpu,cpuset 0 0 diff --git a/tests/vircgroupdata/all-in-one.parsed b/tests/vircgroupdata/all-in-one.parsed new file mode 100644 index 0000000..2701778 --- /dev/null +++ b/tests/vircgroupdata/all-in-one.parsed @@ -0,0 +1,10 @@ +cpu /sys/fs/cgroup +cpuacct /sys/fs/cgroup +cpuset /sys/fs/cgroup +memory /sys/fs/cgroup +devices /sys/fs/cgroup +freezer <null> +blkio /sys/fs/cgroup +net_cls <null> +perf_event <null> +name=systemd <null> diff --git a/tests/vircgroupdata/cgroups1.mounts b/tests/vircgroupdata/cgroups1.mounts new file mode 100644 index 0000000..881463a --- /dev/null +++ b/tests/vircgroupdata/cgroups1.mounts @@ -0,0 +1,30 @@ +proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 +udev /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=1494868,mode=755 0 0 +devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0 +sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 +/dev/mapper/root / ext4 rw,noatime,nodiratime,data=ordered 0 0 +tmpfs /run tmpfs rw,nodev,relatime,size=1202892k,mode=755 0 0 +mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0 +shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0 +debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0 +cgroup_root /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755 0 0 +fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0 +openrc /sys/fs/cgroup/openrc cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc 0 0 +cpuset /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 +cpu /sys/fs/cgroup/cpu cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0 +cpuacct /sys/fs/cgroup/cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct 0 0 +memory /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 +devices /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 +freezer /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 +net_cls /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0 +blkio /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 +net_prio /sys/fs/cgroup/net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_prio 0 0 +hugetlb /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0 +/dev/sda1 /boot ext4 ro,noatime,nodiratime 0 0 +/dev/mapper/home /home ext4 rw,noatime,nodiratime,data=ordered 0 0 +/dev/mapper/logs /var/log ext4 rw,noatime,nodiratime,data=ordered 0 0 +/dev/mapper/tmp /tmp ext4 rw,noatime,nodiratime 0 0 +/dev/mapper/images /var/lib/libvirt/images ext4 rw,noatime,nodiratime,data=ordered 0 0 +binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0 +/home/encrypted /home/decrypted ecryptfs rw,nosuid,nodev,noexec,relatime,ecryptfs_fnek_sig=abcdefabcdefabcd,ecryptfs_sig=efabcdefabcdefab,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_unlink_sigs 0 0 +/etc/autofs/auto.remote /mnt/remote autofs rw,relatime,fd=7,pgrp=511017,timeout=300,minproto=5,maxproto=5,indirect 0 0 diff --git a/tests/vircgroupdata/cgroups1.parsed b/tests/vircgroupdata/cgroups1.parsed new file mode 100644 index 0000000..b6916f1 --- /dev/null +++ b/tests/vircgroupdata/cgroups1.parsed @@ -0,0 +1,10 @@ +cpu /sys/fs/cgroup/cpu +cpuacct /sys/fs/cgroup/cpuacct +cpuset /sys/fs/cgroup/cpuset +memory /sys/fs/cgroup/memory +devices /sys/fs/cgroup/devices +freezer /sys/fs/cgroup/freezer +blkio /sys/fs/cgroup/blkio +net_cls /sys/fs/cgroup/net_cls +perf_event <null> +name=systemd <null> diff --git a/tests/vircgroupdata/cgroups2.mounts b/tests/vircgroupdata/cgroups2.mounts new file mode 100644 index 0000000..21ab867 --- /dev/null +++ b/tests/vircgroupdata/cgroups2.mounts @@ -0,0 +1,22 @@ +rootfs / rootfs rw 0 0 +proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 +udev /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=1006404,mode=755 0 0 +devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0 +sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 +/dev/sda1 / ext4 rw,noatime,data=ordered 0 0 +tmpfs /run tmpfs rw,nodev,relatime,size=812296k,mode=755 0 0 +mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0 +shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0 +debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0 +cgroup_root /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755 0 0 +openrc /sys/fs/cgroup/openrc cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc 0 0 +cpuset /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 +cpu /sys/fs/cgroup/cpu cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0 +cpuacct /sys/fs/cgroup/cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct 0 0 +memory /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 +devices /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 +freezer /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 +blkio /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 +perf_event /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 +hugetlb /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0 +binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0 diff --git a/tests/vircgroupdata/cgroups2.parsed b/tests/vircgroupdata/cgroups2.parsed new file mode 100644 index 0000000..5eb2bc7 --- /dev/null +++ b/tests/vircgroupdata/cgroups2.parsed @@ -0,0 +1,10 @@ +cpu /sys/fs/cgroup/cpu +cpuacct /sys/fs/cgroup/cpuacct +cpuset /sys/fs/cgroup/cpuset +memory /sys/fs/cgroup/memory +devices /sys/fs/cgroup/devices +freezer /sys/fs/cgroup/freezer +blkio /sys/fs/cgroup/blkio +net_cls <null> +perf_event /sys/fs/cgroup/perf_event +name=systemd <null> diff --git a/tests/vircgroupdata/cgroups3.mounts b/tests/vircgroupdata/cgroups3.mounts new file mode 100644 index 0000000..6d80e04 --- /dev/null +++ b/tests/vircgroupdata/cgroups3.mounts @@ -0,0 +1,28 @@ +/dev/rootvg/root / ext4 rw,noatime,data=ordered 0 0 +proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 +tmpfs /run tmpfs rw,nosuid,nodev,noexec,relatime,mode=755 0 0 +sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 +dev /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=2039630,mode=755 0 0 +securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 +debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0 +mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0 +configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0 +devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 +cgroup_root /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755 0 0 +tmpfs /dev/shm tmpfs rw,relatime 0 0 +fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0 +efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0 +openrc /sys/fs/cgroup/openrc cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc 0 0 +cpuset /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 +cpu /sys/fs/cgroup/cpu cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0 +cpuacct /sys/fs/cgroup/cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct 0 0 +memory /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 +devices /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 +freezer /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 +net_cls /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0 +blkio /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 +perf_event /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 +net_prio /sys/fs/cgroup/net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_prio 0 0 +hugetlb /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0 +tmpfs /tmp tmpfs rw,nosuid,noexec,relatime,size=3278448k 0 0 +binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0 diff --git a/tests/vircgroupdata/cgroups3.parsed b/tests/vircgroupdata/cgroups3.parsed new file mode 100644 index 0000000..2b1f382 --- /dev/null +++ b/tests/vircgroupdata/cgroups3.parsed @@ -0,0 +1,10 @@ +cpu /sys/fs/cgroup/cpu +cpuacct /sys/fs/cgroup/cpuacct +cpuset /sys/fs/cgroup/cpuset +memory /sys/fs/cgroup/memory +devices /sys/fs/cgroup/devices +freezer /sys/fs/cgroup/freezer +blkio /sys/fs/cgroup/blkio +net_cls /sys/fs/cgroup/net_cls +perf_event /sys/fs/cgroup/perf_event +name=systemd <null> diff --git a/tests/vircgroupdata/fedora-18.mounts b/tests/vircgroupdata/fedora-18.mounts new file mode 100644 index 0000000..dfe2852 --- /dev/null +++ b/tests/vircgroupdata/fedora-18.mounts @@ -0,0 +1,30 @@ +rootfs / rootfs rw 0 0 +proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 +sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0 +devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=2006080k,nr_inodes=501520,mode=755 0 0 +securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 +selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0 +tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev 0 0 +devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 +tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0 +tmpfs /sys/fs/cgroup tmpfs rw,seclabel,nosuid,nodev,noexec,mode=755 0 0 +cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 +pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 +cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 +cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0 +cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 +cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 +cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 +cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0 +cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 +cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 +/dev/vda1 / ext4 rw,seclabel,relatime,data=ordered 0 0 +rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0 +systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=27,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 +mqueue /dev/mqueue mqueue rw,seclabel,relatime 0 0 +tmpfs /tmp tmpfs rw,seclabel 0 0 +debugfs /sys/kernel/debug debugfs rw,relatime 0 0 +hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime 0 0 +configfs /sys/kernel/config configfs rw,relatime 0 0 +192.168.122.1:/home/qemu /home/qemu nfs rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.122.1,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr=192.168.122.1 0 0 +192.168.122.1:/var/lib/libvirt/images /var/lib/libvirt/images nfs rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.122.1,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr=192.168.122.1 0 0 diff --git a/tests/vircgroupdata/fedora-18.parsed b/tests/vircgroupdata/fedora-18.parsed new file mode 100644 index 0000000..8d5ba75 --- /dev/null +++ b/tests/vircgroupdata/fedora-18.parsed @@ -0,0 +1,10 @@ +cpu /sys/fs/cgroup/cpu,cpuacct +cpuacct /sys/fs/cgroup/cpu,cpuacct +cpuset /sys/fs/cgroup/cpuset +memory /sys/fs/cgroup/memory +devices /sys/fs/cgroup/devices +freezer /sys/fs/cgroup/freezer +blkio /sys/fs/cgroup/blkio +net_cls /sys/fs/cgroup/net_cls +perf_event /sys/fs/cgroup/perf_event +name=systemd /sys/fs/cgroup/systemd diff --git a/tests/vircgroupdata/fedora-21.mounts b/tests/vircgroupdata/fedora-21.mounts new file mode 100644 index 0000000..dfa0a0f --- /dev/null +++ b/tests/vircgroupdata/fedora-21.mounts @@ -0,0 +1,33 @@ +rootfs / rootfs rw,seclabel 0 0 +sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0 +proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 +devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=2013724k,nr_inodes=503431,mode=755 0 0 +securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 +tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev 0 0 +devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 +tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0 +tmpfs /sys/fs/cgroup tmpfs ro,seclabel,nosuid,nodev,noexec,mode=755 0 0 +cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 +pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 +cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 +cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0 +cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 +cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 +cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 +cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0 +cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 +cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 +cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0 +configfs /sys/kernel/config configfs rw,relatime 0 0 +/dev/vda2 / ext4 rw,seclabel,relatime,data=ordered 0 0 +selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0 +systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=28,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 +hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime 0 0 +mqueue /dev/mqueue mqueue rw,seclabel,relatime 0 0 +debugfs /sys/kernel/debug debugfs rw,relatime 0 0 +tmpfs /tmp tmpfs rw,seclabel 0 0 +sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0 +nfsd /proc/fs/nfsd nfsd rw,relatime 0 0 +/dev/vda1 /boot ext4 rw,seclabel,relatime,data=ordered 0 0 +tmpfs /run/user/1000 tmpfs rw,seclabel,nosuid,nodev,relatime,size=404756k,mode=700,uid=1000,gid=1000 0 0 +tmpfs /run/user/0 tmpfs rw,seclabel,nosuid,nodev,relatime,size=404756k,mode=700 0 0 diff --git a/tests/vircgroupdata/fedora-21.parsed b/tests/vircgroupdata/fedora-21.parsed new file mode 100644 index 0000000..3377af0 --- /dev/null +++ b/tests/vircgroupdata/fedora-21.parsed @@ -0,0 +1,10 @@ +cpu /sys/fs/cgroup/cpu,cpuacct +cpuacct /sys/fs/cgroup/cpu,cpuacct +cpuset /sys/fs/cgroup/cpuset +memory /sys/fs/cgroup/memory +devices /sys/fs/cgroup/devices +freezer /sys/fs/cgroup/freezer +blkio /sys/fs/cgroup/blkio +net_cls /sys/fs/cgroup/net_cls,net_prio +perf_event /sys/fs/cgroup/perf_event +name=systemd /sys/fs/cgroup/systemd diff --git a/tests/vircgroupdata/no-cgroups.mounts b/tests/vircgroupdata/no-cgroups.mounts new file mode 100644 index 0000000..8173e41 --- /dev/null +++ b/tests/vircgroupdata/no-cgroups.mounts @@ -0,0 +1,10 @@ +rootfs / rootfs rw 0 0 +sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 +proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 +udev /dev devtmpfs rw,relatime,size=10240k,nr_inodes=256016,mode=755 0 0 +devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 +tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=206096k,mode=755 0 0 +/dev/disk/by-uuid/e5690604-413c-4782-ab67-b3678cea9f80 / ext4 rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered 0 0 +tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0 +tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=549800k 0 0 +rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0 diff --git a/tests/vircgroupdata/no-cgroups.parsed b/tests/vircgroupdata/no-cgroups.parsed new file mode 100644 index 0000000..bf4eea0 --- /dev/null +++ b/tests/vircgroupdata/no-cgroups.parsed @@ -0,0 +1,10 @@ +cpu <null> +cpuacct <null> +cpuset <null> +memory <null> +devices <null> +freezer <null> +blkio <null> +net_cls <null> +perf_event <null> +name=systemd <null> diff --git a/tests/vircgroupdata/ovirt-node-6.6.mounts b/tests/vircgroupdata/ovirt-node-6.6.mounts new file mode 100644 index 0000000..ef07f4f --- /dev/null +++ b/tests/vircgroupdata/ovirt-node-6.6.mounts @@ -0,0 +1,144 @@ +rootfs / rootfs rw 0 0 +proc /proc proc rw,relatime 0 0 +sysfs /sys sysfs rw,seclabel,relatime 0 0 +devtmpfs /dev devtmpfs rw,seclabel,relatime,size=132240744k,nr_inodes=33060186,mode=755 0 0 +devpts /dev/pts devpts rw,seclabel,relatime,gid=5,mode=620,ptmxmode=000 0 0 +tmpfs /dev/shm tmpfs rw,seclabel,relatime 0 0 +/dev/sdi2 /dev/.initramfs/live ext2 ro,seclabel,relatime,errors=continue 0 0 +/dev/mapper/live-rw / ext2 ro,seclabel,relatime,errors=continue,user_xattr,acl 0 0 +none /selinux selinuxfs rw,relatime 0 0 +devtmpfs /dev devtmpfs rw,seclabel,relatime,size=132240744k,nr_inodes=33060186,mode=755 0 0 +/proc/bus/usb /proc/bus/usb usbfs rw,relatime 0 0 +none /var/lib/stateless/writable tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/cache/man tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lock tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/log tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/run tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/dbus tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/nfs tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /tmp tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/cache/hald tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/dhclient tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/tmp tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /media tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/iscsi tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/logrotate.status tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/ntp tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/random-seed tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/spool tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /etc tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/net-snmp tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/dnsmasq tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /root/.ssh tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /root/.uml tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/cache/libvirt tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/libvirt tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/cache/multipathd tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /mnt tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /boot tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /boot-kdump tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /cgroup tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/yum tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/cache/yum tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /usr/share/snmp/mibs tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/lldpad tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/cache/rpcbind tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /usr/share/snmp/mibs tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/lldpad tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/cache/rpcbind tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/cache/rhn tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/db tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /usr/libexec/vdsm/hooks tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /var/lib/vdsm tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +none /rhev/data-center tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0 +/dev/mapper/HostVG-Config /config ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/fstab ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/shadow ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/default/ovirt ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/rsyslog.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/libvirt/passwd.db ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/passwd ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/libvirt/qemu/networks ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/sshd_config ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/pki ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/iscsi/initiatorname.iscsi ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/random-seed ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/keyboard ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/iptables ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/resolv.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ntp.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/hosts ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/shadow ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/vdsm/vdsm.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/vdsm-reg/vdsm-reg.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-lo ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/multipath.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/shadow ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/virt-who ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/vdsm/persistence ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +tmpfs /dev/shm tmpfs rw,rootcontext=system_u:object_r:tmpfs_t:s0,seclabel,relatime 0 0 +debugfs /sys/kernel/debug debugfs rw,relatime 0 0 +/dev/mapper/HostVG-Logging /var/log ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0 +/dev/mapper/HostVG-Data /data ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0 +/dev/mapper/HostVG-Data /var/lib/libvirt/images ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0 +/dev/mapper/HostVG-Data /var/log/core ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0 +none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0 +/dev/mapper/HostVG-Logging /tmp/early-logs ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/ssh_host_key ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/ssh_host_key.pub ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/ssh_host_dsa_key ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/ssh_host_dsa_key.pub ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/ssh_host_rsa_key ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/ssh_host_rsa_key.pub ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/udev/rules.d/71-persistent-node-net.rules ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/vdsm/vdsm.id ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/udev/rules.d/12-ovirt-iosched.rules ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /root/.ssh/authorized_keys ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/vdsm/upgrade/upgrade-unified-persistence ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.11 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.100 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.200 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.21 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.3 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.31 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.4 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.41 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.5 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.51 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.6 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-eth0 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-eth1 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-eth2 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-eth3 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-rhevm ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_info ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_migration ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_servers ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_test ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_views ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_vms_ant ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_vms_lim ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_vms_ovl ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_vms_vlb ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_vms_wvl ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.10 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_personeel ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +tmpfs /dev/shm tmpfs rw,rootcontext=system_u:object_r:tmpfs_t:s0,seclabel,relatime 0 0 +/dev/mapper/HostVG-Data /var/lib/libvirt/images ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0 +/dev/mapper/HostVG-Data /var/log/core ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/libvirt/libvirtd.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/libvirtd ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/libvirt/qemu.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/libvirt/qemu-sanlock.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/logrotate.d/libvirtd ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0 +cgroup /cgroup/cpuset cgroup rw,relatime,cpuset 0 0 +cgroup /cgroup/cpu cgroup rw,relatime,cpu 0 0 +cgroup /cgroup/cpuacct cgroup rw,relatime,cpuacct 0 0 +cgroup /cgroup/memory cgroup rw,relatime,memory 0 0 +cgroup /cgroup/devices cgroup rw,relatime,devices 0 0 +cgroup /cgroup/freezer cgroup rw,relatime,freezer 0 0 +cgroup /cgroup/net_cls cgroup rw,relatime,net_cls 0 0 +cgroup /cgroup/blkio cgroup rw,relatime,blkio 0 0 +sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0 diff --git a/tests/vircgroupdata/ovirt-node-6.6.parsed b/tests/vircgroupdata/ovirt-node-6.6.parsed new file mode 100644 index 0000000..01bf466 --- /dev/null +++ b/tests/vircgroupdata/ovirt-node-6.6.parsed @@ -0,0 +1,10 @@ +cpu /cgroup/cpu +cpuacct /cgroup/cpuacct +cpuset /cgroup/cpuset +memory /cgroup/memory +devices /cgroup/devices +freezer /cgroup/freezer +blkio /cgroup/blkio +net_cls /cgroup/net_cls +perf_event <null> +name=systemd <null> diff --git a/tests/vircgroupdata/ovirt-node-7.1.mounts b/tests/vircgroupdata/ovirt-node-7.1.mounts new file mode 100644 index 0000000..74f7db9 --- /dev/null +++ b/tests/vircgroupdata/ovirt-node-7.1.mounts @@ -0,0 +1,142 @@ +rootfs / rootfs rw 0 0 +proc /proc proc rw,relatime 0 0 +sysfs /sys sysfs rw,seclabel,relatime 0 0 +devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=3922156k,nr_inodes=980539,mode=755 0 0 +securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 +tmpfs /dev/shm tmpfs rw,seclabel,relatime 0 0 +devpts /dev/pts devpts rw,seclabel,relatime,gid=5,mode=620,ptmxmode=000 0 0 +tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0 +tmpfs /sys/fs/cgroup tmpfs rw,seclabel,nosuid,nodev,noexec,mode=755 0 0 +cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 +pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 +cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 +cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0 +cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 +cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 +cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 +cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0 +cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 +cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 +cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0 +configfs /sys/kernel/config configfs rw,relatime 0 0 +/dev/sda3 /run/initramfs/live ext2 ro,seclabel,relatime 0 0 +/dev/mapper/live-rw / ext2 ro,seclabel,noatime 0 0 +rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0 +selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0 +systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=33,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 +mqueue /dev/mqueue mqueue rw,seclabel,relatime 0 0 +hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime 0 0 +debugfs /sys/kernel/debug debugfs rw,relatime 0 0 +none /var/lib/stateless/writable tmpfs rw,seclabel,relatime 0 0 +none /var/cache/man tmpfs rw,seclabel,relatime 0 0 +none /var/log tmpfs rw,seclabel,relatime 0 0 +none /var/lib/dbus tmpfs rw,seclabel,relatime 0 0 +none /tmp tmpfs rw,seclabel,relatime 0 0 +none /var/lib/dhclient tmpfs rw,seclabel,relatime 0 0 +none /var/tmp tmpfs rw,seclabel,relatime 0 0 +none /var/lib/iscsi tmpfs rw,seclabel,relatime 0 0 +none /var/lib/logrotate.status tmpfs rw,seclabel,relatime 0 0 +none /var/lib/ntp tmpfs rw,seclabel,relatime 0 0 +none /var/lib/random-seed tmpfs rw,seclabel,relatime 0 0 +none /var/spool tmpfs rw,seclabel,relatime 0 0 +none /var/lib/nfs tmpfs rw,seclabel,relatime 0 0 +none /var/lib/ovirt-hosted-engine-setup tmpfs rw,seclabel,relatime 0 0 +none /etc tmpfs rw,seclabel,relatime 0 0 +none /var/lib/net-snmp tmpfs rw,seclabel,relatime 0 0 +none /var/lib/dnsmasq tmpfs rw,seclabel,relatime 0 0 +none /root/.ssh tmpfs rw,seclabel,relatime 0 0 +none /root/.uml tmpfs rw,seclabel,relatime 0 0 +none /var/cache/libvirt tmpfs rw,seclabel,relatime 0 0 +none /var/lib/libvirt tmpfs rw,seclabel,relatime 0 0 +none /var/cache/multipathd tmpfs rw,seclabel,relatime 0 0 +none /mnt tmpfs rw,seclabel,relatime 0 0 +none /boot tmpfs rw,seclabel,relatime 0 0 +none /boot-kdump tmpfs rw,seclabel,relatime 0 0 +none /var/lib/yum tmpfs rw,seclabel,relatime 0 0 +none /var/cache/yum tmpfs rw,seclabel,relatime 0 0 +none /usr/share/snmp/mibs tmpfs rw,seclabel,relatime 0 0 +none /var/lib/lldpad tmpfs rw,seclabel,relatime 0 0 +none /usr/share/snmp/mibs tmpfs rw,seclabel,relatime 0 0 +none /var/lib/stateless/writable/usr/share/snmp/mibs tmpfs rw,seclabel,relatime 0 0 +none /var/lib/lldpad tmpfs rw,seclabel,relatime 0 0 +none /var/lib/stateless/writable/var/lib/lldpad tmpfs rw,seclabel,relatime 0 0 +none /var/cache/rhn tmpfs rw,seclabel,relatime 0 0 +none /var/db tmpfs rw,seclabel,relatime 0 0 +none /usr/libexec/vdsm/hooks tmpfs rw,seclabel,relatime 0 0 +none /var/lib/vdsm tmpfs rw,seclabel,relatime 0 0 +none /rhev/data-center tmpfs rw,seclabel,relatime 0 0 +none /var/lib/dhclient tmpfs rw,seclabel,relatime 0 0 +none /var/lib/stateless/writable/var/lib/dhclient tmpfs rw,seclabel,relatime 0 0 +/dev/mapper/HostVG-Config /config ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/fstab ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/fstab ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/hosts ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/hosts ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/sysconfig/network ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-lo ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/sysconfig/network-scripts/ifcfg-lo ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/resolv.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/resolv.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ntp.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ntp.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/sshd_config ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/sshd_config ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/kdump.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/kdump.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/default/ovirt ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/default/ovirt ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/rsyslog.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/rsyslog.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/libvirt/passwd.db ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/libvirt/passwd.db ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/libvirt/qemu ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/libvirt/qemu ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/pki ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/pki ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/iscsi/initiatorname.iscsi ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/iscsi/initiatorname.iscsi ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/random-seed ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/var/lib/random-seed ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/glusterd ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/virt-who ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/sysconfig/virt-who ext4 rw,seclabel,noatime,data=ordered 0 0 +sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0 +sunrpc /var/lib/stateless/writable/var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0 +none /tmp/early-logs tmpfs rw,seclabel,relatime 0 0 +none /var/lib/stateless/writable/tmp/early-logs tmpfs rw,seclabel,relatime 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-em1 ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/sysconfig/network-scripts/ifcfg-em1 ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/ssh_host_rsa_key ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/ssh_host_rsa_key ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/ssh_host_rsa_key.pub ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/ssh_host_rsa_key.pub ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/ssh_host_ecdsa_key ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/ssh_host_ecdsa_key ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/ssh_host_ecdsa_key.pub ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/ssh_host_ecdsa_key.pub ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/ssh_host_ed25519_key ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/ssh_host_ed25519_key ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/ssh/ssh_host_ed25519_key.pub ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/ssh_host_ed25519_key.pub ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Logging /var/log ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Logging /var/lib/stateless/writable/tmp/early-logs ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Logging /var/lib/stateless/writable/var/log ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Data /data ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Data /var/lib/libvirt/images ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Data /var/lib/stateless/writable/var/lib/libvirt/images ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Data /var/log/core ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Data /var/lib/stateless/writable/tmp/early-logs/core ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Data /var/lib/stateless/writable/var/log/core ext4 rw,seclabel,noatime,data=ordered 0 0 +tmpfs /dev/.initramfs tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0 +/dev/sda3 /dev/.initramfs/live ext2 ro,seclabel,relatime 0 0 +/dev/mapper/HostVG-Config /etc/libvirt/libvirtd.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/libvirt/libvirtd.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/sysconfig/libvirtd ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/sysconfig/libvirtd ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/libvirt/qemu.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/libvirt/qemu.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/libvirt/qemu-sanlock.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/libvirt/qemu-sanlock.conf ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /etc/logrotate.d/libvirtd ext4 rw,seclabel,noatime,data=ordered 0 0 +/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/logrotate.d/libvirtd ext4 rw,seclabel,noatime,data=ordered 0 0 diff --git a/tests/vircgroupdata/ovirt-node-7.1.parsed b/tests/vircgroupdata/ovirt-node-7.1.parsed new file mode 100644 index 0000000..8d5ba75 --- /dev/null +++ b/tests/vircgroupdata/ovirt-node-7.1.parsed @@ -0,0 +1,10 @@ +cpu /sys/fs/cgroup/cpu,cpuacct +cpuacct /sys/fs/cgroup/cpu,cpuacct +cpuset /sys/fs/cgroup/cpuset +memory /sys/fs/cgroup/memory +devices /sys/fs/cgroup/devices +freezer /sys/fs/cgroup/freezer +blkio /sys/fs/cgroup/blkio +net_cls /sys/fs/cgroup/net_cls +perf_event /sys/fs/cgroup/perf_event +name=systemd /sys/fs/cgroup/systemd diff --git a/tests/vircgroupdata/rhel-7.1.mounts b/tests/vircgroupdata/rhel-7.1.mounts new file mode 100644 index 0000000..1d6aaea --- /dev/null +++ b/tests/vircgroupdata/rhel-7.1.mounts @@ -0,0 +1,31 @@ +rootfs / rootfs rw 0 0 +proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 +sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0 +devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=3038192k,nr_inodes=759548,mode=755 0 0 +securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 +tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev 0 0 +devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 +tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0 +tmpfs /sys/fs/cgroup tmpfs rw,seclabel,nosuid,nodev,noexec,mode=755 0 0 +cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 +pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 +cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 +cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0 +cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 +cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 +cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 +cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0 +cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 +cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 +cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0 +configfs /sys/kernel/config configfs rw,relatime 0 0 +/dev/sda7 / ext4 rw,seclabel,relatime,data=ordered 0 0 +selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0 +systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=36,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 +mqueue /dev/mqueue mqueue rw,seclabel,relatime 0 0 +debugfs /sys/kernel/debug debugfs rw,relatime 0 0 +hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime 0 0 +sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0 +nfsd /proc/fs/nfsd nfsd rw,relatime 0 0 +/dev/sda4 /home ext4 rw,seclabel,relatime,data=ordered 0 0 +colossus:/data/nfsroot /virt-nfs nfs4 rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=1.2.3.4,local_lock=none,addr=1.2.3.5 0 0 diff --git a/tests/vircgroupdata/rhel-7.1.parsed b/tests/vircgroupdata/rhel-7.1.parsed new file mode 100644 index 0000000..8d5ba75 --- /dev/null +++ b/tests/vircgroupdata/rhel-7.1.parsed @@ -0,0 +1,10 @@ +cpu /sys/fs/cgroup/cpu,cpuacct +cpuacct /sys/fs/cgroup/cpu,cpuacct +cpuset /sys/fs/cgroup/cpuset +memory /sys/fs/cgroup/memory +devices /sys/fs/cgroup/devices +freezer /sys/fs/cgroup/freezer +blkio /sys/fs/cgroup/blkio +net_cls /sys/fs/cgroup/net_cls +perf_event /sys/fs/cgroup/perf_event +name=systemd /sys/fs/cgroup/systemd diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index cc1825b..efad77d 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -158,6 +158,58 @@ const char *linksLogind[VIR_CGROUP_CONTROLLER_LAST] = { }; +static int +testCgroupDetectMounts(const void *args) +{ + int result = -1; + const char *file = args; + char *mounts = NULL; + char *parsed = NULL; + char *expected = NULL; + const char *actual; + virCgroupPtr group = NULL; + virBuffer buf = VIR_BUFFER_INITIALIZER; + size_t i; + + if (virAsprintf(&mounts, "%s/vircgroupdata/%s.mounts", + abs_srcdir, file) < 0 || + virAsprintf(&parsed, "%s/vircgroupdata/%s.parsed", + abs_srcdir, file) < 0 || + VIR_ALLOC(group) < 0) + goto cleanup; + + if (virCgroupDetectMountsFromFile(group, mounts, false) < 0) + goto cleanup; + + if (virtTestLoadFile(parsed, &expected) < 0) + goto cleanup; + + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { + virBufferAsprintf(&buf, "%-12s %s\n", + virCgroupControllerTypeToString(i), + NULLSTR(group->controllers[i].mountPoint)); + } + if (virBufferCheckError(&buf) < 0) + goto cleanup; + + actual = virBufferCurrentContent(&buf); + if (STRNEQ(expected, actual)) { + virtTestDifference(stderr, expected, actual); + goto cleanup; + } + + result = 0; + + cleanup: + VIR_FREE(mounts); + VIR_FREE(parsed); + VIR_FREE(expected); + virCgroupFree(&group); + virBufferFreeAndReset(&buf); + return result; +} + + static int testCgroupNewForSelf(const void *args ATTRIBUTE_UNUSED) { virCgroupPtr cgroup = NULL; @@ -793,6 +845,25 @@ mymain(void) setenv("LIBVIRT_FAKE_SYSFS_DIR", fakesysfsdir, 1); +# define DETECT_MOUNTS(file) \ + do { \ + if (virtTestRun("Detect cgroup mounts for " file, \ + testCgroupDetectMounts, \ + file) < 0) \ + ret = -1; \ + } while (0) + + DETECT_MOUNTS("ovirt-node-6.6"); + DETECT_MOUNTS("ovirt-node-7.1"); + DETECT_MOUNTS("fedora-18"); + DETECT_MOUNTS("fedora-21"); + DETECT_MOUNTS("rhel-7.1"); + DETECT_MOUNTS("cgroups1"); + DETECT_MOUNTS("cgroups2"); + DETECT_MOUNTS("cgroups3"); + DETECT_MOUNTS("all-in-one"); + DETECT_MOUNTS("no-cgroups"); + if (virtTestRun("New cgroup for self", testCgroupNewForSelf, NULL) < 0) ret = -1; -- 2.3.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list