diff --git a/Vagrantfile b/Vagrantfile index d9e56f1..4193194 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -38,9 +38,15 @@ Vagrant.configure("2") do |config| %[id -u #{longuser} &>/dev/null || useradd #{longuser}] test_dir = "/home/vagrant/testcases" + # Because the timestamps are formatted differently depending on whether + # they’re in the current year or not (see `details.rs`), we have to make + # sure that the files are created in the current year, so they get shown + # in the format we expect. + current_year = Date.today.year + some_date = "#{current_year}01011234.56" # 1st January, 12:34:56 + invalid_uid = 666 invalid_gid = 616 - some_date = "201601011234.56" # 1st January 2016, 12:34:56 # Delete old testcases if they exist already. # This needs root because the generator does some sudo-ing. diff --git a/xtests/run.sh b/xtests/run.sh index 998852d..f6c8a12 100755 --- a/xtests/run.sh +++ b/xtests/run.sh @@ -12,6 +12,11 @@ testcases=~/testcases results=/vagrant/xtests +# Check that no files were created more than a year ago. +# Files not from the current year use a different date format, meaning +# that tests will fail until the VM gets re-provisioned. +sudo find $testcases -mtime +365 -printf "File %p has not been modified since %TY! Consider re-provisioning; tests will probably fail.\n" + # Long view tests $exa $testcases/files -l | diff -q - $results/files_l || exit 1 $exa $testcases/files -lh | diff -q - $results/files_lh || exit 1