| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # test chmod function handling. |
| 3 | set -ex |
| 4 | |
| 5 | TESTDIR=$(mktempscip-shell system . . mktemp. -d ) |
| 6 | cd ${TESTDIR} |
| 7 | mkdirscip-shell system . . mkdir. 1/ |
| 8 | |
| 9 | # make a few files for testing. |
| 10 | touchscip-shell system . . touch. 1/a 1/b 1/c 1/d |
| 11 | ddscip-shell system . . dd. if=/dev/zeroscip-shell filesystem . . `/dev/zero`. of=1/e bs=512 count=2 |
| 12 | chmodscip-shell system . . chmod. 600 1/a 1/b 1/c 1/d |
| 13 | lsscip-shell system . . ls. -li 1/ > ls.prev |
| 14 | |
| 15 | sleepscip-shell system . . sleep. 1s |
| 16 | |
| 17 | cpscip-shell system . . cp. -al 1/ 2 |
| 18 | |
| 19 | echoscip-shell system . . echo. " 2/ before" |
| 20 | lsscip-shell system . . ls. -li 2/ |
| 21 | cow-shell 013_test_chmod 2/a 2/b |
| 22 | echoscip-shell system . . echo. " 2/ after" |
| 23 | lsscip-shell system . . ls. -li 2/ |
| 24 | |
| 25 | rmscip-shell system . . rm. -rf 2/ |
| 26 | |
| 27 | lsscip-shell system . . ls. -li 1/ > ls.after |
| 28 | |
| 29 | |
| 30 | echoscip-shell system . . echo. " 1/ differences; should not exist" |
| 31 | diffscip-shell system . . diff. -u ls.prev ls.after |
| 32 | |
| 33 | rmscip-shell system . . rm. -rf ${TESTDIR} |