2 # SPDX-License-Identifier: LGPL-2.1+
5 [ -n "${DEBUG:-}" ] && set -x
10 dirname=$
(dirname ${cmdline})
11 topdir
=$
(dirname ${dirname})
13 testdir
=`mktemp -t -d libs.XXX`
14 installdir
=`mktemp -t -d libs.XXX`
16 libdir
=${installdir}/usr
/lib
/lxcfs
17 bindir
=${installdir}/usr
/bin
22 if [ ${lxcfspid} -ne -1 ]; then
25 while [ -d ${testdir}/proc
-a $count -lt 5 ]; do
30 rm -rf ${testdir} ${installdir}
31 rm -f /tmp
/lxcfs-iwashere
33 if [ ${FAILED} -eq 1 ]; then
34 echo "liblxcfs.so reload test FAILED"
36 echo "liblxcfs.so reload test PASSED"
40 trap cleanup EXIT HUP INT TERM
42 echo "==> Installing lxcfs to temporary path"
43 ( cd ${topdir}; DESTDIR
=${installdir} make -s install >/dev
/null
2>&1)
44 if [ -n "${LD_LIBRARY_PATH:-}" ]; then
45 export LD_LIBRARY_PATH
="${libdir}:${LD_LIBRARY_PATH}"
47 export LD_LIBRARY_PATH
=${libdir}
50 echo "==> Spawning lxcfs"
51 ${bindir}/lxcfs -p ${pidfile} ${testdir} &
56 while [ ! -d ${testdir}/proc
]; do
62 rm -f /tmp
/lxcfs-iwashere
64 echo "==> Testing that lxcfs is functional"
65 cat ${testdir}/proc
/uptime
67 [ ! -f /tmp
/lxcfs-iwashere
]
70 make -s liblxcfstest.la
71 gcc
-shared -fPIC -DPIC -Wl,-soname,liblxcfs.so .libs
/liblxcfstest_la-
*.o cgroups
/.libs
/liblxcfstest_la-
*.o
-lpthread -pthread -o .libs
/liblxcfstest.so
72 cp .libs
/liblxcfstest.
* "${libdir}"
74 rm -f ${libdir}/liblxcfs.so
* ${libdir}/liblxcfs.la
75 cp ${libdir}/liblxcfstest.so
${libdir}/liblxcfs.so
77 kill -USR1 ${lxcfspid}
79 cat ${testdir}/proc
/uptime
81 [ -f /tmp
/lxcfs-iwashere
]