summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxstat
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-13 21:13:13 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-13 21:13:13 +0000
commitb05cc329587c7b42d03f291410b5ba9caf8c92b6 (patch)
tree90113ab40c2a00b8d16d0b44f4bd40bb44889270 /testsuites/psxtests/psxstat
parent2010-07-12 Jennifer Averett (diff)
downloadrtems-b05cc329587c7b42d03f291410b5ba9caf8c92b6.tar.bz2
2010-07-12 Bharath Suri <bharath.s.jois@gmail.com>
PR 1613/testing * psxfchx01/init.c, psxfchx01/Makefile.am, psxfchx01/.cvsignore, psxfchx01/psxfchx01.doc, psxfchx01/psxfchx01.scn: New tests. Improves coverage of fchdir, fchmod, fchown directives. * configure.ac, Makefile.am: Changes to accommodate new test. * psxstat/test.c, psxstat/psxstat.scn: Added new test case to test statvfs routine under libcsupport.
Diffstat (limited to '')
-rw-r--r--testsuites/psxtests/psxstat/psxstat.scn5
-rw-r--r--testsuites/psxtests/psxstat/test.c25
2 files changed, 30 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxstat/psxstat.scn b/testsuites/psxtests/psxstat/psxstat.scn
index 20525b0d2f..c8cc62e0b7 100644
--- a/testsuites/psxtests/psxstat/psxstat.scn
+++ b/testsuites/psxtests/psxstat/psxstat.scn
@@ -1,3 +1,4 @@
+
*** STAT TEST 01 ***
--->Current Time: - rtems_clock_get_tod - 09:00:00 12/31/1988
Making directory /my_mount_point/dir1
@@ -1703,6 +1704,10 @@ lstat( /my_mount_point/symlinks/a_dir_symlink/a_file_symlink ) returned
...st_ctime Sat Dec 31 09:00:35 1988
...st_blksize 0
...st_blocks 0
+statvfs, with invalid path - expect EFAULT
+create /tmp -- OK
+statvfs, with valid path - expect ENOTSUP
+statvfs tested!
*** END OF STAT TEST 01 ***
diff --git a/testsuites/psxtests/psxstat/test.c b/testsuites/psxtests/psxstat/test.c
index 0549806763..90f1431dfc 100644
--- a/testsuites/psxtests/psxstat/test.c
+++ b/testsuites/psxtests/psxstat/test.c
@@ -774,6 +774,29 @@ void Show_Time(void)
print_time( " - rtems_clock_get_tod - ", &time, "\n" );
}
+void test_statvfs( void )
+{
+
+ int status = 0;
+ struct statvfs stat;
+
+ puts( "statvfs, with invalid path - expect EFAULT" );
+ status = statvfs( NULL , &stat );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EFAULT );
+
+ puts( "create /tmp -- OK" );
+ status = mkdir( "/tmp", 0777 );
+ rtems_test_assert( status == 0 );
+
+ puts( "statvfs, with valid path - expect ENOTSUP" );
+ status = statvfs( "/tmp", &stat );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == ENOTSUP );
+
+ puts( "statvfs tested!" );
+}
+
/*
* main entry point to the test
*/
@@ -902,6 +925,8 @@ int main(
status = rtems_task_wake_after( TIMEOUT_VALUE );
lchown_multiple_files( SymLinks );
+ test_statvfs();
+
puts( "\n\n*** END OF STAT TEST 01 ***" );
rtems_test_exit(0);
}