diff options
Diffstat (limited to 'testsuites/libtests/tar01/init.c')
-rw-r--r-- | testsuites/libtests/tar01/init.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testsuites/libtests/tar01/init.c b/testsuites/libtests/tar01/init.c index 4bfa29c636..7d4f1b9a2a 100644 --- a/testsuites/libtests/tar01/init.c +++ b/testsuites/libtests/tar01/init.c @@ -46,6 +46,16 @@ void test_cat( int length ); +static void test_untar_check_mode(const char* file, int mode) +{ + struct stat sb; + int fmode; + rtems_test_assert(stat(file, &sb) == 0); + fmode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + printf(" %s: mode: %04o want: %04o\n", file, fmode, mode); + rtems_test_assert(fmode == mode); +} + void test_untar_from_memory(void) { rtems_status_code sc; @@ -66,6 +76,11 @@ void test_untar_from_memory(void) test_cat( "/home/test_file", 0, 0 ); /******************/ + printf( "========= /home/test_script =========\n" ); + test_cat( "/home/test_script", 0, 0 ); + test_untar_check_mode("/home/test_script", 0755); + + /******************/ printf( "========= /symlink =========\n" ); test_cat( "/symlink", 0, 0 ); @@ -107,6 +122,11 @@ void test_untar_from_file(void) test_cat( "/dest/home/test_file", 0, 0 ); /******************/ + printf( "========= /dest/home/test_script =========\n" ); + test_cat( "/dest/home/test_script", 0, 0 ); + test_untar_check_mode("/dest/home/test_script", 0755); + + /******************/ printf( "========= /dest/symlink =========\n" ); test_cat( "/dest/symlink", 0, 0 ); } @@ -144,6 +164,11 @@ void test_untar_chunks_from_memory(void) test_cat( "/dest2/home/test_file", 0, 0 ); /******************/ + printf( "========= /dest2/home/test_script =========\n" ); + test_cat( "/dest2/home/test_script", 0, 0 ); + test_untar_check_mode("/dest2/home/test_script", 0755); + + /******************/ printf( "========= /dest2/symlink =========\n" ); test_cat( "/dest2/symlink", 0, 0 ); @@ -184,6 +209,11 @@ void test_untar_unzip_tgz(void) test_cat( "/dest3/home/test_file", 0, 0 ); /******************/ + printf( "========= /dest3/home/test_script =========\n" ); + test_cat( "/dest3/home/test_script", 0, 0 ); + test_untar_check_mode("/dest3/home/test_script", 0755); + + /******************/ printf( "========= /dest3/symlink =========\n" ); test_cat( "/dest3/symlink", 0, 0 ); } |