From ba366fc855fa09776336f85c0c6d82faa1dc171d Mon Sep 17 00:00:00 2001 From: Ben S Date: Sat, 29 Oct 2016 19:58:34 +0100 Subject: [PATCH] Add some symlink testcases --- Vagrantfile | 1 + xtests/links | 1 + xtests/links_1 | 4 ++++ xtests/links_T | 7 +++++++ xtests/run.sh | 6 ++++++ 5 files changed, 19 insertions(+) create mode 100644 xtests/links create mode 100644 xtests/links_1 create mode 100644 xtests/links_T diff --git a/Vagrantfile b/Vagrantfile index efb8ec6..ff05f89 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -110,6 +110,7 @@ Vagrant.configure("2") do |config| ln -s / "#{test_dir}/links/root" ln -s /usr "#{test_dir}/links/usr" ln -s nowhere "#{test_dir}/links/broken" + ln -s /proc/1/root "#{test_dir}/links/forbidden" EOF # Awkward passwd testcases. diff --git a/xtests/links b/xtests/links new file mode 100644 index 0000000..4eada4b --- /dev/null +++ b/xtests/links @@ -0,0 +1 @@ +broken forbidden root usr diff --git a/xtests/links_1 b/xtests/links_1 new file mode 100644 index 0000000..faacfa2 --- /dev/null +++ b/xtests/links_1 @@ -0,0 +1,4 @@ +broken -> /home/vagrant/testcases/links/nowhere +forbidden -> /proc/1/root +root -> / +usr -> /usr diff --git a/xtests/links_T b/xtests/links_T new file mode 100644 index 0000000..081fa07 --- /dev/null +++ b/xtests/links_T @@ -0,0 +1,7 @@ +/home/vagrant/testcases/links +├── broken -> /home/vagrant/testcases/links/nowhere +│ └──  +├── forbidden -> /proc/1/root +│ └──  +├── root -> / +└── usr -> /usr diff --git a/xtests/run.sh b/xtests/run.sh index 27caaf4..827b1fe 100755 --- a/xtests/run.sh +++ b/xtests/run.sh @@ -46,5 +46,11 @@ $exa $testcases/permissions -lghR 2>&1 | diff -q - $results/permissions || exit # File types $exa $testcases/file-types -1 2>&1 | diff -q - $results/file-types || exit 1 +# Links +$exa $testcases/links -1 2>&1 | diff -q - $results/links_1 || exit 1 +$exa $testcases/links -T 2>&1 | diff -q - $results/links_T || exit 1 + +COLUMNS=80 $exa $testcases/links 2>&1 | diff -q - $results/links || exit 1 + echo "All the tests passed!"