Lines Matching refs:ASSERT_EQ
385 ASSERT_EQ(prepare_unpriv_mountns(), 0); in FIXTURE_SETUP()
390 ASSERT_EQ(mount("testing", "/tmp", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
393 ASSERT_EQ(mkdir("/tmp/B", 0777), 0); in FIXTURE_SETUP()
395 ASSERT_EQ(mount("testing", "/tmp/B", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
398 ASSERT_EQ(mkdir("/tmp/B/BB", 0777), 0); in FIXTURE_SETUP()
400 ASSERT_EQ(mount("testing", "/tmp/B/BB", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
403 ASSERT_EQ(mount("testing", "/mnt", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
406 ASSERT_EQ(mkdir("/mnt/A", 0777), 0); in FIXTURE_SETUP()
408 ASSERT_EQ(mount("testing", "/mnt/A", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
411 ASSERT_EQ(mkdir("/mnt/A/AA", 0777), 0); in FIXTURE_SETUP()
413 ASSERT_EQ(mount("/tmp", "/mnt/A/AA", NULL, MS_BIND | MS_REC, NULL), 0); in FIXTURE_SETUP()
415 ASSERT_EQ(mkdir("/mnt/B", 0777), 0); in FIXTURE_SETUP()
417 ASSERT_EQ(mount("testing", "/mnt/B", "ramfs", in FIXTURE_SETUP()
420 ASSERT_EQ(mkdir("/mnt/B/BB", 0777), 0); in FIXTURE_SETUP()
422 ASSERT_EQ(mount("testing", "/tmp/B/BB", "devpts", in FIXTURE_SETUP()
427 ASSERT_EQ(symlink(NOSYMFOLLOW_TARGET, NOSYMFOLLOW_SYMLINK), 0); in FIXTURE_SETUP()
428 ASSERT_EQ(close(fd), 0); in FIXTURE_SETUP()
491 ASSERT_EQ(errno, EFAULT); in TEST_F()
495 ASSERT_EQ(errno, EINVAL); in TEST_F()
498 ASSERT_EQ(errno, EINVAL); in TEST_F()
502 ASSERT_EQ(errno, EINVAL); in TEST_F()
506 ASSERT_EQ(errno, EINVAL); in TEST_F()
508 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, in TEST_F()
517 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, in TEST_F()
524 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
527 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
530 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
533 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
550 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", 0, &attr, sizeof(attr)), 0); in TEST_F()
559 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
562 ASSERT_EQ(new_flags, old_flags); in TEST_F()
565 ASSERT_EQ(new_flags, old_flags); in TEST_F()
568 ASSERT_EQ(new_flags, old_flags); in TEST_F()
586 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, &attr, sizeof(attr)), 0); in TEST_F()
595 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
598 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
601 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
604 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
609 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, &attr, sizeof(attr)), 0); in TEST_F()
613 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
615 ASSERT_EQ(is_shared_mount("/mnt/A"), true); in TEST_F()
618 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
620 ASSERT_EQ(is_shared_mount("/mnt/A/AA"), true); in TEST_F()
623 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
625 ASSERT_EQ(is_shared_mount("/mnt/A/AA/B"), true); in TEST_F()
628 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
630 ASSERT_EQ(is_shared_mount("/mnt/A/AA/B/BB"), true); in TEST_F()
643 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
645 ASSERT_EQ(is_shared_mount("/mnt/A"), true); in TEST_F()
648 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
650 ASSERT_EQ(is_shared_mount("/mnt/A/AA"), true); in TEST_F()
653 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
655 ASSERT_EQ(is_shared_mount("/mnt/A/AA/B"), true); in TEST_F()
658 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
660 ASSERT_EQ(is_shared_mount("/mnt/A/AA/B/BB"), true); in TEST_F()
692 ASSERT_EQ(new_flags, old_flags); in TEST_F()
694 ASSERT_EQ(is_shared_mount("/mnt/A"), false); in TEST_F()
697 ASSERT_EQ(new_flags, old_flags); in TEST_F()
699 ASSERT_EQ(is_shared_mount("/mnt/A/AA"), false); in TEST_F()
702 ASSERT_EQ(new_flags, old_flags); in TEST_F()
704 ASSERT_EQ(is_shared_mount("/mnt/A/AA/B"), false); in TEST_F()
707 ASSERT_EQ(new_flags, old_flags); in TEST_F()
709 ASSERT_EQ(is_shared_mount("/mnt/A/AA/B/BB"), false); in TEST_F()
720 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, &attr, sizeof(attr)), 0); in TEST_F()
740 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/B", AT_RECURSIVE, &attr, sizeof(attr)), 0); in TEST_F()
747 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
754 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
791 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, &attr, sizeof(attr)), 0); in TEST_F()
798 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
801 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
804 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
807 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
813 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, &attr, sizeof(attr)), 0); in TEST_F()
819 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
822 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
825 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
828 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
834 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, &attr, sizeof(attr)), 0); in TEST_F()
839 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
842 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
845 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
848 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
854 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, &attr, sizeof(attr)), 0); in TEST_F()
858 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
861 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
864 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
867 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
870 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, &attr, sizeof(attr)), 0); in TEST_F()
873 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
876 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
879 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
882 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
886 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, &attr, sizeof(attr)), 0); in TEST_F()
891 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
894 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
897 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
900 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
923 ASSERT_EQ(pthread_create(&threads[i], &pattr, mount_setattr_thread, NULL), 0); in TEST_F()
935 ASSERT_EQ(ret, 0); in TEST_F()
941 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
943 ASSERT_EQ(is_shared_mount("/mnt/A"), true); in TEST_F()
946 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
948 ASSERT_EQ(is_shared_mount("/mnt/A/AA"), true); in TEST_F()
951 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
953 ASSERT_EQ(is_shared_mount("/mnt/A/AA/B"), true); in TEST_F()
956 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
958 ASSERT_EQ(is_shared_mount("/mnt/A/AA/B/BB"), true); in TEST_F()
974 ASSERT_EQ(errno, EPERM); in TEST_F()
990 ASSERT_EQ(unshare(CLONE_NEWNS), 0); in TEST_F()
994 ASSERT_EQ(errno, EINVAL); in TEST_F()
1004 ASSERT_EQ(unshare(CLONE_NEWNS), 0); in FIXTURE_SETUP()
1006 ASSERT_EQ(mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0), 0); in FIXTURE_SETUP()
1011 ASSERT_EQ(mount("testing", "/tmp", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
1014 ASSERT_EQ(mkdir("/tmp/B", 0777), 0); in FIXTURE_SETUP()
1015 ASSERT_EQ(mknodat(-EBADF, "/tmp/B/b", S_IFREG | 0644, 0), 0); in FIXTURE_SETUP()
1016 ASSERT_EQ(chown("/tmp/B/b", 0, 0), 0); in FIXTURE_SETUP()
1018 ASSERT_EQ(mount("testing", "/tmp/B", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
1021 ASSERT_EQ(mkdir("/tmp/B/BB", 0777), 0); in FIXTURE_SETUP()
1022 ASSERT_EQ(mknodat(-EBADF, "/tmp/B/BB/b", S_IFREG | 0644, 0), 0); in FIXTURE_SETUP()
1023 ASSERT_EQ(chown("/tmp/B/BB/b", 0, 0), 0); in FIXTURE_SETUP()
1025 ASSERT_EQ(mount("testing", "/tmp/B/BB", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
1028 ASSERT_EQ(mount("testing", "/mnt", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
1031 ASSERT_EQ(mkdir("/mnt/A", 0777), 0); in FIXTURE_SETUP()
1033 ASSERT_EQ(mount("testing", "/mnt/A", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
1036 ASSERT_EQ(mkdir("/mnt/A/AA", 0777), 0); in FIXTURE_SETUP()
1038 ASSERT_EQ(mount("/tmp", "/mnt/A/AA", NULL, MS_BIND | MS_REC, NULL), 0); in FIXTURE_SETUP()
1040 ASSERT_EQ(mkdir("/mnt/B", 0777), 0); in FIXTURE_SETUP()
1042 ASSERT_EQ(mount("testing", "/mnt/B", "ramfs", in FIXTURE_SETUP()
1045 ASSERT_EQ(mkdir("/mnt/B/BB", 0777), 0); in FIXTURE_SETUP()
1047 ASSERT_EQ(mount("testing", "/tmp/B/BB", "devpts", in FIXTURE_SETUP()
1050 ASSERT_EQ(mkdir("/mnt/C", 0777), 0); in FIXTURE_SETUP()
1051 ASSERT_EQ(mkdir("/mnt/D", 0777), 0); in FIXTURE_SETUP()
1054 ASSERT_EQ(ftruncate(img_fd, 1024 * 2048), 0); in FIXTURE_SETUP()
1055 ASSERT_EQ(system("mkfs.ext4 -q /mnt/C/ext4.img"), 0); in FIXTURE_SETUP()
1056 ASSERT_EQ(system("mount -o loop -t ext4 /mnt/C/ext4.img /mnt/D/"), 0); in FIXTURE_SETUP()
1057 ASSERT_EQ(close(img_fd), 0); in FIXTURE_SETUP()
1147 ASSERT_EQ(errno, EPERM); in TEST_F()
1148 ASSERT_EQ(close(attr.userns_fd), 0); in TEST_F()
1149 ASSERT_EQ(close(open_tree_fd), 0); in TEST_F()
1257 ASSERT_EQ(close(attr.userns_fd), 0); in TEST_F()
1258 ASSERT_EQ(close(open_tree_fd), 0); in TEST_F()
1284 ASSERT_EQ(unshare(CLONE_NEWNS), 0); in TEST_F()
1290 ASSERT_EQ(close(attr.userns_fd), 0); in TEST_F()
1291 ASSERT_EQ(close(open_tree_fd), 0); in TEST_F()
1318 ASSERT_EQ(sys_mount_setattr(open_tree_fd, "", in TEST_F()
1320 ASSERT_EQ(close(attr.userns_fd), 0); in TEST_F()
1321 ASSERT_EQ(close(open_tree_fd), 0); in TEST_F()
1345 ASSERT_EQ(unshare(CLONE_NEWNS), 0); in TEST_F()
1350 ASSERT_EQ(sys_mount_setattr(open_tree_fd, "", in TEST_F()
1352 ASSERT_EQ(close(attr.userns_fd), 0); in TEST_F()
1353 ASSERT_EQ(close(open_tree_fd), 0); in TEST_F()
1379 ASSERT_EQ(sys_mount_setattr(open_tree_fd, "", in TEST_F()
1381 ASSERT_EQ(close(attr.userns_fd), 0); in TEST_F()
1387 ASSERT_EQ(close(attr.userns_fd), 0); in TEST_F()
1388 ASSERT_EQ(close(open_tree_fd), 0); in TEST_F()
1414 ASSERT_EQ(expected_uid_gid(-EBADF, "/tmp/B/b", 0, 0, 0), 0); in TEST_F()
1415 ASSERT_EQ(expected_uid_gid(-EBADF, "/tmp/B/BB/b", 0, 0, 0), 0); in TEST_F()
1417 ASSERT_EQ(mount("testing", "/mnt/A", "ramfs", MS_NOATIME | MS_NODEV, in TEST_F()
1420 ASSERT_EQ(mkdir("/mnt/A/AA", 0777), 0); in TEST_F()
1422 ASSERT_EQ(mount("/tmp", "/mnt/A/AA", NULL, MS_BIND | MS_REC, NULL), 0); in TEST_F()
1436 ASSERT_EQ(close(attr.userns_fd), 0); in TEST_F()
1437 ASSERT_EQ(close(open_tree_fd), 0); in TEST_F()
1439 ASSERT_EQ(expected_uid_gid(-EBADF, "/tmp/B/b", 0, 0, 0), 0); in TEST_F()
1440 ASSERT_EQ(expected_uid_gid(-EBADF, "/tmp/B/BB/b", 0, 0, 0), 0); in TEST_F()
1441 ASSERT_EQ(expected_uid_gid(open_tree_fd, "B/b", 0, 0, 0), 0); in TEST_F()
1442 ASSERT_EQ(expected_uid_gid(open_tree_fd, "B/BB/b", 0, 0, 0), 0); in TEST_F()
1460 ASSERT_EQ(close(fd), 0); in TEST_F()
1465 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, &attr, sizeof(attr)), 0); in TEST_F()
1471 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
1474 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
1477 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
1480 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
1484 ASSERT_EQ(errno, ELOOP); in TEST_F()
1489 ASSERT_EQ(sys_mount_setattr(-1, "/mnt/A", AT_RECURSIVE, &attr, sizeof(attr)), 0); in TEST_F()
1493 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
1496 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
1499 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
1502 ASSERT_EQ(new_flags, expected_flags); in TEST_F()
1506 ASSERT_EQ(close(fd), 0); in TEST_F()