2012-03-23 15:40:04 +05:30
|
|
|
#
|
|
|
|
# Testsuite for lib/fileutils program
|
|
|
|
#
|
|
|
|
|
2016-07-10 04:34:44 +05:30
|
|
|
set testprog "${topdir}lib/test_fileutils"
|
|
|
|
set scriptdir [file dirname [ info script ]]
|
2012-03-23 15:40:04 +05:30
|
|
|
|
|
|
|
set test "without argument"
|
2016-07-10 04:34:44 +05:30
|
|
|
spawn $testprog
|
2012-03-23 15:40:04 +05:30
|
|
|
expect_pass "$test" "Hello, World!"
|
|
|
|
|
2016-07-10 04:34:44 +05:30
|
|
|
set badfd "${scriptdir}/fileutils_badfd.sh"
|
2012-03-23 15:40:04 +05:30
|
|
|
set test "test bad file descriptor"
|
2016-07-10 04:34:44 +05:30
|
|
|
spawn $badfd $testprog
|
2012-03-23 15:40:04 +05:30
|
|
|
expect_pass "$test" "test_fileutils: write error: Bad file descriptor"
|
|
|
|
|
2016-07-10 04:34:44 +05:30
|
|
|
set full "${scriptdir}/fileutils_full.sh"
|
2012-03-23 15:40:04 +05:30
|
|
|
set test "test no space left on device"
|
2016-07-10 04:34:44 +05:30
|
|
|
spawn $full $testprog
|
2012-03-23 15:40:04 +05:30
|
|
|
expect_pass "$test" "test_fileutils: write error: No space left on device"
|