@@ -485,7 +485,7 @@ static int test_epoll(char *str, int len)
485485
486486static char mnt_point [32 ];
487487
488- static int test_mount (char * str , int len )
488+ static int test_mount_dev (char * str , int len )
489489{
490490 long ret ;
491491
@@ -500,11 +500,11 @@ static int test_mount(char *str, int len)
500500 return TEST_FAILURE ;
501501}
502502
503- static int test_chdir (char * str , int len )
503+ static int test_chdir (char * str , int len , const char * path )
504504{
505505 long ret ;
506506
507- ret = lkl_sys_chdir (mnt_point );
507+ ret = lkl_sys_chdir (path );
508508
509509 snprintf (str , len , "%ld" , ret );
510510
@@ -556,7 +556,7 @@ static int test_getdents64(char *str, int len)
556556 return TEST_SUCCESS ;
557557}
558558
559- static int test_umount (char * str , int len )
559+ static int test_umount_dev (char * str , int len )
560560{
561561 long ret , ret2 , ret3 ;
562562
@@ -574,6 +574,36 @@ static int test_umount(char *str, int len)
574574 return TEST_FAILURE ;
575575}
576576
577+ static int test_mount_fs (char * str , int len , char * fs )
578+ {
579+ long ret ;
580+
581+ ret = lkl_mount_fs (fs );
582+
583+ snprintf (str , len , "%s: %ld" , fs , ret );
584+
585+ if (ret == 0 )
586+ return TEST_SUCCESS ;
587+
588+ return TEST_FAILURE ;
589+ }
590+
591+ static int test_umount_fs (char * str , int len , char * fs )
592+ {
593+ long ret , ret2 , ret3 ;
594+
595+ ret = lkl_sys_close (dir_fd );
596+ ret2 = lkl_sys_chdir ("/" );
597+ ret3 = lkl_umount_timeout (fs , 0 , 1000 );
598+
599+ snprintf (str , len , "%s: %ld %ld %ld" , fs , ret , ret2 , ret3 );
600+
601+ if (!ret && !ret2 && !ret3 )
602+ return TEST_SUCCESS ;
603+
604+ return TEST_FAILURE ;
605+ }
606+
577607static int test_lo_ifup (char * str , int len )
578608{
579609 long ret ;
@@ -781,7 +811,8 @@ int main(int argc, char **argv)
781811
782812 lkl_host_ops .print = printk ;
783813
784- TEST (disk_add );
814+ if (cla .disk_filename )
815+ TEST (disk_add );
785816#ifndef __MINGW32__
786817 if (cla .tap_ifname )
787818 TEST (netdev_add );
@@ -807,11 +838,18 @@ int main(int argc, char **argv)
807838#endif /* __MINGW32__ */
808839 TEST (pipe2 );
809840 TEST (epoll );
810- TEST (mount );
811- TEST (chdir );
841+ TEST (mount_fs , "proc" );
842+ TEST (chdir , "proc" );
812843 TEST (opendir );
813844 TEST (getdents64 );
814- TEST (umount );
845+ TEST (umount_fs , "proc" );
846+ if (cla .disk_filename ) {
847+ TEST (mount_dev );
848+ TEST (chdir , mnt_point );
849+ TEST (opendir );
850+ TEST (getdents64 );
851+ TEST (umount_dev );
852+ }
815853 TEST (lo_ifup );
816854 TEST (mutex );
817855 TEST (semaphore );
0 commit comments