From 1310ba87c0f9045b9ddb96b73816e82a811d4f1b Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Sun, 28 Apr 2019 23:37:47 +0300 Subject: Fixed vagrant tests. Removed Vagrant test for Ubuntu 12.04, added 18.04. --- tests/internals/test_internals_valgrind.sh | 10 ++++++++-- tests/internals/test_rate_limiter_valgrind.sh | 10 ++++++++-- tests/test_bindfs.rb | 3 ++- vagrant/bionic64/Vagrantfile | 25 +++++++++++++++++++++++++ vagrant/centos6/Vagrantfile | 3 ++- vagrant/precise64/Vagrantfile | 25 ------------------------- vagrant/test.rb | 2 +- 7 files changed, 46 insertions(+), 32 deletions(-) create mode 100644 vagrant/bionic64/Vagrantfile delete mode 100644 vagrant/precise64/Vagrantfile diff --git a/tests/internals/test_internals_valgrind.sh b/tests/internals/test_internals_valgrind.sh index 4511ccd..837a3cc 100755 --- a/tests/internals/test_internals_valgrind.sh +++ b/tests/internals/test_internals_valgrind.sh @@ -1,5 +1,11 @@ -#!/bin/sh +#!/bin/sh -eu if [ ! -x ./test_internals ]; then cd `dirname "$0"` fi -valgrind --error-exitcode=100 ./test_internals + +if [ -n "`which valgrind`" ]; then + valgrind --error-exitcode=100 ./test_internals +else + echo "Warning: valgrind not found. Running without." + ./test_internals +fi diff --git a/tests/internals/test_rate_limiter_valgrind.sh b/tests/internals/test_rate_limiter_valgrind.sh index bf0a7cd..5958492 100755 --- a/tests/internals/test_rate_limiter_valgrind.sh +++ b/tests/internals/test_rate_limiter_valgrind.sh @@ -1,5 +1,11 @@ -#!/bin/sh +#!/bin/sh -eu if [ ! -x ./test_rate_limiter ]; then cd `dirname "$0"` fi -valgrind --error-exitcode=100 ./test_rate_limiter + +if [ -n "`which valgrind`" ]; then + valgrind --error-exitcode=100 ./test_rate_limiter +else + echo "Warning: valgrind not found. Running without." + ./test_rate_limiter +fi diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb index 9e5d381..a6ecf2c 100755 --- a/tests/test_bindfs.rb +++ b/tests/test_bindfs.rb @@ -764,12 +764,13 @@ end # Pull Request #73 if `uname`.strip == 'Linux' && + `uname -r`.strip =~ /^[456789]/ && # 3.x kernels used by CentOS 7 and older don't support all `unshare` options despite the userspace binary supporting them `which unshare` != '' && `unshare --help`.include?("--map-root-user") && `unshare --help`.include?("--user") root_testenv("--gid-offset=10000", :title => "setgid and gid-offset") do system("chmod g+s src") - system("unshare --map-root-user --user #{$nobody} mkdir mnt/dir") + system("unshare --map-root-user --user mkdir mnt/dir") assert { File.stat("src/dir").gid == 0 } assert { File.stat("mnt/dir").gid == 10000 } end diff --git a/vagrant/bionic64/Vagrantfile b/vagrant/bionic64/Vagrantfile new file mode 100644 index 0000000..aab9518 --- /dev/null +++ b/vagrant/bionic64/Vagrantfile @@ -0,0 +1,25 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.box = "ubuntu/bionic64" + + config.vm.synced_folder ".", "/vagrant", disabled: true + config.vm.synced_folder "../../", "/bindfs", + type: "rsync", + rsync__auto: false, + rsync__exclude: ["vagrant"], + rsync__args: ["-av", "--delete-after"] + + config.vm.provider "virtualbox" do |v| + v.name = "bindfs-bionic64" + end + + config.vm.provision "shell", inline: <<-SHELL + apt-get update + apt-get install -y fuse libfuse-dev build-essential pkg-config ruby valgrind + apt-get clean + adduser vagrant fuse + echo user_allow_other > /etc/fuse.conf + SHELL +end diff --git a/vagrant/centos6/Vagrantfile b/vagrant/centos6/Vagrantfile index 7ad975e..ae291fe 100644 --- a/vagrant/centos6/Vagrantfile +++ b/vagrant/centos6/Vagrantfile @@ -15,8 +15,9 @@ Vagrant.configure("2") do |config| v.name = "bindfs-centos6" end + # Don't install valgrind here since it appears to be broken (2019-04-28) config.vm.provision "shell", inline: <<-SHELL - yum install -y fuse fuse-devel gcc make pkg-config ruby valgrind + yum install -y fuse fuse-devel gcc make pkg-config ruby usermod -G fuse -a vagrant echo user_allow_other > /etc/fuse.conf SHELL diff --git a/vagrant/precise64/Vagrantfile b/vagrant/precise64/Vagrantfile deleted file mode 100644 index 22acd58..0000000 --- a/vagrant/precise64/Vagrantfile +++ /dev/null @@ -1,25 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - config.vm.box = "ubuntu/precise64" - - config.vm.synced_folder ".", "/vagrant", disabled: true - config.vm.synced_folder "../../", "/bindfs", - type: "rsync", - rsync__auto: false, - rsync__exclude: ["vagrant"], - rsync__args: ["-av", "--delete-after"] - - config.vm.provider "virtualbox" do |v| - v.name = "bindfs-precise64" - end - - config.vm.provision "shell", inline: <<-SHELL - apt-get update - apt-get install -y fuse libfuse-dev build-essential pkg-config ruby1.9.3 valgrind - apt-get clean - adduser vagrant fuse - echo user_allow_other > /etc/fuse.conf - SHELL -end diff --git a/vagrant/test.rb b/vagrant/test.rb index b8489b6..f6d068f 100755 --- a/vagrant/test.rb +++ b/vagrant/test.rb @@ -82,7 +82,7 @@ threads = dirs.map do |dir| unless run_and_log.call "vagrant rsync" raise "vagrant rsync failed" end - unless run_and_log.call "vagrant ssh -c 'cd /bindfs && sudo rm -Rf tests/tmp_test_bindfs && ./configure && make clean && make && make check && sudo make check'" + unless run_and_log.call "vagrant ssh -c 'cd /bindfs && sudo rm -Rf tests/tmp_test_bindfs && ./configure && make distclean && ./configure && make && make check && sudo make check'" mutex.synchronize do errors << "VM #{dir} tests failed." end -- cgit v1.2.3