skip sudo tests by default unless in CI

This commit is contained in:
Valient Gough 2017-08-25 22:29:52 -07:00
parent 72e21f3c09
commit e2e1fadfa9
No known key found for this signature in database
GPG Key ID: 33C65E29813C14DF
2 changed files with 6 additions and 6 deletions

View File

@ -37,14 +37,14 @@ matrix:
- clang-4.0 - clang-4.0
- clang-tidy-4.0 - clang-tidy-4.0
env: env:
- CC=clang-4.0 CXX=clang++-4.0 CHECK=true INTEGRATION=true SUDO_MOUNT=sudo - CC=clang-4.0 CXX=clang++-4.0 CHECK=true INTEGRATION=true SUDO_TESTS=true
- os: osx - os: osx
compiler: clang compiler: clang
osx_image: xcode8.3 osx_image: xcode8.3
sudo: true sudo: true
env: env:
- INTEGRATION=true SUDO_MOUNT=sudo - INTEGRATION=true SUDO_TESTS=true
before_script: before_script:
- ./ci/setup.sh - ./ci/setup.sh

View File

@ -443,8 +443,8 @@ sub checkReadError
# Test that write errors are correctly thrown up to us # Test that write errors are correctly thrown up to us
sub checkWriteError sub checkWriteError
{ {
# Not sure how to implement this on Mac OS, so feel free ! # No OSX impl, and requires sudo which is inconvenient outside of CI.
if($^O eq "darwin") { if($^O eq "darwin" || !defined($ENV{'SUDO_TESTS'})) {
ok(1, "write error"); ok(1, "write error");
ok(1, "write error"); ok(1, "write error");
ok(1, "write error"); ok(1, "write error");
@ -455,7 +455,7 @@ sub checkWriteError
my $mnt = "$workingDir/checkWriteError.mnt"; my $mnt = "$workingDir/checkWriteError.mnt";
mkdir($crypt) || BAIL_OUT($!); mkdir($crypt) || BAIL_OUT($!);
mkdir($mnt) || BAIL_OUT($!); mkdir($mnt) || BAIL_OUT($!);
system(($ENV{'SUDO_MOUNT'}||"")." mount -t tmpfs -o size=1m tmpfs $crypt"); system("sudo mount -t tmpfs -o size=1m tmpfs $crypt");
ok( $? == 0, "mount command returns 0") || return; ok( $? == 0, "mount command returns 0") || return;
system("./build/encfs --standard --extpass=\"echo test\" $crypt $mnt 2>&1"); system("./build/encfs --standard --extpass=\"echo test\" $crypt $mnt 2>&1");
ok( $? == 0, "encfs command returns 0") || return; ok( $? == 0, "encfs command returns 0") || return;
@ -464,6 +464,6 @@ sub checkWriteError
ok ($!{ENOSPC}, "write returned $! instead of ENOSPC"); ok ($!{ENOSPC}, "write returned $! instead of ENOSPC");
close OUT; close OUT;
portable_unmount($mnt); portable_unmount($mnt);
system(($ENV{'SUDO_MOUNT'}||"")." umount $crypt"); system("sudo umount $crypt");
} }
} }