3 # Exercise the PMCD privileged co-process (root) PMDA
4 # Install, Remove and handling of different container
5 # engines container.* metrics.
7 # Copyright (c) 2014-2015 Red Hat.
11 echo "QA output created by $seq"
13 # get standard environment, filters and checks
23 _notrun
"No container support for PCP_PLATFORM $PCP_PLATFORM"
30 $unix_domain_sockets || _notrun
"No unix domain socket support available"
33 status
=1 # failure is the default!
34 $sudo rm -rf $tmp.
* $seq.full
39 [ -d $root ] && sudo
rm -fr $root
40 [ -f $tmp.conf.backup
] && sudo
cp $tmp.conf.backup
$PCP_DIR/etc
/pcp.conf
44 # do metrics one at a time, map all internal instance ids to N and sort
49 pminfo containers | LC_COLLATE
=POSIX
sort \
52 pminfo
-f $metric >$tmp.tmp
53 grep -v ' inst \[' $tmp.tmp
54 sed -n -e '/inst \[/s/\[[0-9][0-9]*/[N/p' $tmp.tmp \
55 | LC_COLLATE
=POSIX
sort
59 _prepare_pmda root containers
60 trap "root_cleanup; exit \$status" 0 1 2 3 15
62 # backup main PCP config
63 cp $PCP_DIR/etc
/pcp.conf
$tmp.conf
64 cp $PCP_DIR/etc
/pcp.conf
$tmp.conf.backup
66 # simple testing script for LXC containers
67 cat >$tmp.test-lxc-info.sh
<<EOF
70 test -d "\$PCP_LXC_DIR/\$name" || exit 0
74 echo "CPU use: 1.13 seconds"
76 chmod 755 $tmp.test-lxc-info.sh
77 export PCP_LXC_DIR
=$root/var
/lib
/lxc
79 # real QA test starts here
80 $sudo $PCP_RC_DIR/pmcd stop | _filter_pcp_stop
82 echo "# from QA $seq ..." >> $tmp.conf
83 echo PCP_LXC_DIR
=$root/var
/lib
/lxc
>> $tmp.conf
84 echo PCP_LXC_INFO
=$tmp.test-lxc-info.sh
>> $tmp.conf
85 echo PCP_DOCKER_DIR
=$root/var
/lib
/docker
>> $tmp.conf
86 echo PCP_SYSTEMD_CGROUP
=/tmp
>> $tmp.conf
87 $sudo cp $tmp.conf
$PCP_DIR/etc
/pcp.conf
88 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
91 echo "=== Checking empty containers configuration, no values"
92 pmprobe
-v containers | LC_COLLATE
=POSIX
sort
93 echo "== done" && echo
95 tarballs
=`echo $here/linux/containers-*.tgz | LC_COLLATE=POSIX sort`
99 mkdir
$root || _fail
"root in use when processing $tgz"
104 echo "== Checking values for active containers"
106 echo && echo "== done" && echo