Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/fs/union Add failing test cases for PRs kern/2423, ker...



details:   https://anonhg.NetBSD.org/src/rev/1f85166e5950
branches:  trunk
changeset: 352340:1f85166e5950
user:      maya <maya%NetBSD.org@localhost>
date:      Sun Mar 26 18:26:05 2017 +0000

description:
Add failing test cases for PRs kern/2423, kern/3645, kern/4597

diffstat:

 tests/fs/union/t_pr.c |  108 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 107 insertions(+), 1 deletions(-)

diffs (129 lines):

diff -r 083cc53b50af -r 1f85166e5950 tests/fs/union/t_pr.c
--- a/tests/fs/union/t_pr.c     Sun Mar 26 17:16:03 2017 +0000
+++ b/tests/fs/union/t_pr.c     Sun Mar 26 18:26:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_pr.c,v 1.9 2017/01/13 21:30:40 christos Exp $        */
+/*     $NetBSD: t_pr.c,v 1.10 2017/03/26 18:26:05 maya Exp $   */
 
 #include <sys/types.h>
 #include <sys/mount.h>
@@ -53,6 +53,109 @@
        rump_sys_mount(MOUNT_UNION, "/Tunion", 0,&unionargs,sizeof(unionargs));
 }
 
+ATF_TC(multilayer2);
+ATF_TC_HEAD(multilayer2, tc)
+{
+       atf_tc_set_md_var(tc, "descr", "mount_union twice then unmount");
+}
+
+ATF_TC_BODY(multilayer2, tc)
+{
+       struct union_args unionargs;
+
+       rump_init();
+
+       if (rump_sys_mkdir("/Tunion", 0777) == -1)
+               atf_tc_fail_errno("mkdir mp1");
+       if (rump_sys_mkdir("/Tunion2", 0777) == -1)
+               atf_tc_fail_errno("mkdir mp2");
+       if (rump_sys_mkdir("/Tunion2/A", 0777) == -1)
+               atf_tc_fail_errno("mkdir A");
+       if (rump_sys_mkdir("/Tunion2/B", 0777) == -1)
+               atf_tc_fail_errno("mkdir B");
+
+       unionargs.target = __UNCONST("/Tunion2/A");
+       unionargs.mntflags = UNMNT_ABOVE;
+
+       if (rump_sys_mount(MOUNT_UNION, "/Tunion", 0,
+           &unionargs, sizeof(unionargs)) == -1)
+               atf_tc_fail_errno("union mount");
+       if (rump_sys_mkdir("/Tunion2/A/A", 0777) == -1)
+               atf_tc_fail_errno("mkdir A/A");
+
+       unionargs.target = __UNCONST("/Tunion2/A/A");
+       unionargs.mntflags = UNMNT_ABOVE;
+
+       rump_sys_mount(MOUNT_UNION, "/Tunion", 0,&unionargs,sizeof(unionargs));
+
+       rump_sys_unmount("/Tunion/A", 0);
+}
+
+ATF_TC(cyclic);
+ATF_TC_HEAD(cyclic, tc)
+{
+       atf_tc_set_md_var(tc, "descr", "cyclic mount_union");
+}
+
+ATF_TC_BODY(cyclic, tc)
+{
+       struct union_args unionargs;
+
+       rump_init();
+
+       if (rump_sys_mkdir("/Tunion", 0777) == -1)
+               atf_tc_fail_errno("mkdir mp1");
+       if (rump_sys_mkdir("/Tunion/A", 0777) == -1)
+               atf_tc_fail_errno("mkdir mp2");
+
+       unionargs.target = __UNCONST("/Tunion/A");
+       unionargs.mntflags = UNMNT_ABOVE;
+
+       if (rump_sys_mount(MOUNT_UNION, "/Tunion/A", 0,
+           &unionargs, sizeof(unionargs)) == -1)
+               atf_tc_fail_errno("union mount");
+
+       if (rump_sys_mkdir("/Tunion/A/A", 0777) == -1)
+               atf_tc_fail_errno("mkdir failed");
+}
+
+ATF_TC(cyclic2);
+ATF_TC_HEAD(cyclic2, tc)
+{
+       atf_tc_set_md_var(tc, "descr", "cyclic mount_union");
+}
+
+ATF_TC_BODY(cyclic2, tc)
+{
+       struct union_args unionargs;
+
+       rump_init();
+
+       if (rump_sys_mkdir("/Tunion", 0777) == -1)
+               atf_tc_fail_errno("mkdir mp1");
+       if (rump_sys_mkdir("/Tunion/A", 0777) == -1)
+               atf_tc_fail_errno("mkdir mp2");
+       if (rump_sys_mkdir("/Tunion/B", 0777) == -1)
+               atf_tc_fail_errno("mkdir mp3");
+
+       unionargs.target = __UNCONST("/Tunion/A");
+       unionargs.mntflags = UNMNT_ABOVE;
+
+       if (rump_sys_mount(MOUNT_UNION, "/Tunion/B", 0,
+           &unionargs, sizeof(unionargs)) == -1)
+               atf_tc_fail_errno("union mount");
+
+       unionargs.target = __UNCONST("/Tunion/B");
+       unionargs.mntflags = UNMNT_ABOVE;
+
+       if (rump_sys_mount(MOUNT_UNION, "/Tunion/A", 0,
+           &unionargs, sizeof(unionargs)) == -1)
+               atf_tc_fail_errno("union mount2");
+
+       if (rump_sys_mkdir("/Tunion/A/A", 0777) == -1)
+               atf_tc_fail_errno("mkdir failed");
+}
+
 ATF_TC(devnull1);
 ATF_TC_HEAD(devnull1, tc)
 {
@@ -123,6 +226,9 @@
 ATF_TP_ADD_TCS(tp)
 {
        ATF_TP_ADD_TC(tp, multilayer);
+       ATF_TP_ADD_TC(tp, multilayer2);
+       ATF_TP_ADD_TC(tp, cyclic);
+       ATF_TP_ADD_TC(tp, cyclic2);
        ATF_TP_ADD_TC(tp, devnull1);
        ATF_TP_ADD_TC(tp, devnull2);
 



Home | Main Index | Thread Index | Old Index