Skip to content

Commit ba366fc

Browse files
committed
Add some symlink testcases
1 parent dcc17b1 commit ba366fc

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

Vagrantfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ Vagrant.configure("2") do |config|
110110
ln -s / "#{test_dir}/links/root"
111111
ln -s /usr "#{test_dir}/links/usr"
112112
ln -s nowhere "#{test_dir}/links/broken"
113+
ln -s /proc/1/root "#{test_dir}/links/forbidden"
113114
EOF
114115

115116
# Awkward passwd testcases.

xtests/links

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
broken forbidden root usr

xtests/links_1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
broken -> /home/vagrant/testcases/links/nowhere
2+
forbidden -> /proc/1/root
3+
root -> /
4+
usr -> /usr

xtests/links_T

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/home/vagrant/testcases/links
2+
├── broken -> /home/vagrant/testcases/links/nowhere
3+
│ └── <No such file or directory (os error 2)>
4+
├── forbidden -> /proc/1/root
5+
│ └── <Permission denied (os error 13)>
6+
├── root -> /
7+
└── usr -> /usr

xtests/run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,11 @@ $exa $testcases/permissions -lghR 2>&1 | diff -q - $results/permissions || exit
4646
# File types
4747
$exa $testcases/file-types -1 2>&1 | diff -q - $results/file-types || exit 1
4848

49+
# Links
50+
$exa $testcases/links -1 2>&1 | diff -q - $results/links_1 || exit 1
51+
$exa $testcases/links -T 2>&1 | diff -q - $results/links_T || exit 1
52+
53+
COLUMNS=80 $exa $testcases/links 2>&1 | diff -q - $results/links || exit 1
54+
4955

5056
echo "All the tests passed!"

0 commit comments

Comments
 (0)