提交 5a2ffd3f 编写于 作者: B Benjamin Sago

Generate files with certain timestamps

This is going to be used to test time formatting.

Casualty here is that the “have you not ran the provisioning script in a year?” checker complained about there being files more than a year old, so that now has to ignore the times directory.
上级 652e27e6
......@@ -295,6 +295,33 @@ Vagrant.configure(2) do |config|
EOF
old = '200303030000.00'
med = '200606152314.29'
new = '200907221038.53'
# Awkward date and time testcases.
config.vm.provision :shell, privileged: false, inline: <<-EOF
set -xe
mkdir "#{test_dir}/dates"
# there's no way to touch the created date of a file...
# so we have to do this the old-fashioned way!
# (and make sure these don't actually get listed)
touch -t #{old} "#{test_dir}/dates/peach"; sleep 1
touch -t #{med} "#{test_dir}/dates/plum"; sleep 1
touch -t #{new} "#{test_dir}/dates/pear"
# modified dates
touch -t #{old} -m "#{test_dir}/dates/pear"
touch -t #{med} -m "#{test_dir}/dates/peach"
touch -t #{new} -m "#{test_dir}/dates/plum"
# accessed dates
touch -t #{old} -a "#{test_dir}/dates/plum"
touch -t #{med} -a "#{test_dir}/dates/pear"
touch -t #{new} -a "#{test_dir}/dates/peach"
EOF
# Awkward extended attribute testcases.
config.vm.provision :shell, privileged: false, inline: <<-EOF
......
......@@ -18,7 +18,8 @@ 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"
# (Ignore the folder that deliberately has dates in the past)
sudo find $testcases -mtime +365 -not -path "*/dates/*" -printf "File %p has not been modified since %TY! Consider re-provisioning; tests will probably fail.\n"
# Long view tests
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册