[CRIU] [PATCH] travis: add "make uninstall" test

Kir Kolyshkin kir at openvz.org
Thu Mar 16 14:54:37 PDT 2017


On 03/16/2017 02:49 PM, Andrei Vagin wrote:
> On Mon, Feb 27, 2017 at 10:58:35PM -0800, Kir Kolyshkin wrote:
>> "make uninstall" is supposed to remove all the files that
>> "make install" (with the same arguments) have created.
>> This is a test to check that.
>>
>> PS ideally, "make uninstall" should also remove any empty directories,
>> but let's not care about it for now.
>>
>> Signed-off-by: Kir Kolyshkin <kir at openvz.org>
>> ---
>>   scripts/travis/travis-tests   |  3 ++-
>>   test/others/make/Makefile     |  5 +++++
>>   test/others/make/uninstall.sh | 22 ++++++++++++++++++++++
>>   3 files changed, 29 insertions(+), 1 deletion(-)
>>   create mode 100644 test/others/make/Makefile
>>   create mode 100755 test/others/make/uninstall.sh
>>
>> diff --git a/scripts/travis/travis-tests b/scripts/travis/travis-tests
>> index 75d15f5..21887de 100755
>> --- a/scripts/travis/travis-tests
>> +++ b/scripts/travis/travis-tests
>> @@ -4,7 +4,7 @@ set -x -e
>>   TRAVIS_PKGS="protobuf-c-compiler libprotobuf-c0-dev libaio-dev
>>   		libprotobuf-dev protobuf-compiler python-ipaddr libcap-dev
>>   		libnl-3-dev gcc-multilib libc6-dev-i386 gdb bash python-protobuf
>> -		libnet-dev util-linux"
>> +		libnet-dev util-linux asciidoc"
> Do we really need asciidoc for make install/uninstall?

Unfortunately we do -- criu(8) man page is written in asciidoc,
and installing mans is part of the process.

>>   
>>   travis_prep () {
>>   	[ -n "$SKIP_TRAVIS_PREP" ] && return
>> @@ -55,6 +55,7 @@ bash ./test/jenkins/criu-inhfd.sh
>>   
>>   make -C test/others/mnt-ext-dev/ run
>>   #make -C test/others/exec/ run
>> +make -C test/others/make/ run
>>   
>>   ./test/zdtm.py run -t zdtm/static/env00 --sibling
>>   
>> diff --git a/test/others/make/Makefile b/test/others/make/Makefile
>> new file mode 100644
>> index 0000000..b77b825
>> --- /dev/null
>> +++ b/test/others/make/Makefile
>> @@ -0,0 +1,5 @@
>> +# Tests for the build system
>> +
>> +run:
>> +	./uninstall.sh
>> +.PHONY: run
>> diff --git a/test/others/make/uninstall.sh b/test/others/make/uninstall.sh
>> new file mode 100755
>> index 0000000..ec5a74d
>> --- /dev/null
>> +++ b/test/others/make/uninstall.sh
>> @@ -0,0 +1,22 @@
>> +#!/bin/sh
>> +# A test to make sure "make uninstall" works as intended.
>> +
>> +set -e
>> +SELFDIR=$(dirname $(readlink -f $0))
>> +DESTDIR=$SELFDIR/test.install-$$
>> +cd $SELFDIR/../../..
>> +
>> +set -x
>> +make install DESTDIR=$DESTDIR
>> +make uninstall DESTDIR=$DESTDIR
>> +set +x
>> +
>> +# There should be no files left (directories are OK for now)
>> +if [ $(find $DESTDIR -type f | wc -l) -gt 0 ]; then
>> +	echo "Files left after uninstall:"
>> +	find $DESTDIR -type f
>> +	echo "FAIL"
>> +	exit 1
>> +fi
>> +
>> +echo PASS
>> -- 
>> 2.9.3
>>



More information about the CRIU mailing list