nnn/mktest.sh

33 lines
811 B
Bash
Raw Normal View History

2014-10-22 21:12:57 +00:00
#!/bin/sh
# Create test files and directories
test -e test && {
echo "Remove test and try again"
exit 1
}
mkdir test && cd test
echo 'It works!' > normal.txt
2014-11-14 16:12:14 +00:00
echo 'Με δουλέβει;' > 'κοινό.txt'
2014-10-22 21:12:57 +00:00
ln -s normal.txt ln-normal.txt
ln -s normal.txt ln-normal
mkdir normal-dir
ln -s normal-dir ln-normal-dir
ln -s nowhere ln-nowhere
mkfifo mk-fifo
touch no-access && chmod 000 no-access
2015-07-01 23:58:01 +00:00
mkdir no-access-dir && chmod 000 no-access-dir
2014-10-22 21:12:57 +00:00
ln -s ../normal.txt normal-dir/ln-normal.txt
ln -s ../normal.txt normal-dir/ln-normal
echo 'int main(void) { *((char *)0) = 0; }' > ill.c
make ill > /dev/null
echo 'test/ill' > ill.sh
2015-07-01 23:58:01 +00:00
mkdir empty-dir
mkdir cage
echo 'chmod 000 test/cage' > cage/lock.sh
echo 'chmod 755 test/cage' > cage-unlock.sh
2015-07-02 00:14:27 +00:00
mkdir cage/lion
echo 'chmod 000 test/cage' > cage/lion/lock.sh