From ac229ed8901d487854e4db9ab884898b97d0cc7f Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Thu, 3 Mar 2016 00:35:36 +0100 Subject: tests: move xattr-util related tests to test-xattr-util.c --- src/test/test-util.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'src/test/test-util.c') diff --git a/src/test/test-util.c b/src/test/test-util.c index 3d876ab5e5..77eac221f7 100644 --- a/src/test/test-util.c +++ b/src/test/test-util.c @@ -41,7 +41,6 @@ #include "strv.h" #include "util.h" #include "virt.h" -#include "xattr-util.h" static void test_align_power2(void) { unsigned long i, p2; @@ -275,38 +274,6 @@ static void test_raw_clone(void) { } } -static void test_fgetxattrat_fake(void) { - char t[] = "/var/tmp/xattrtestXXXXXX"; - _cleanup_close_ int fd = -1; - const char *x; - char v[3] = {}; - int r; - - assert_se(mkdtemp(t)); - x = strjoina(t, "/test"); - assert_se(touch(x) >= 0); - - r = setxattr(x, "user.foo", "bar", 3, 0); - if (r < 0 && errno == EOPNOTSUPP) /* no xattrs supported on /var/tmp... */ - goto cleanup; - assert_se(r >= 0); - - fd = open(t, O_RDONLY|O_DIRECTORY|O_CLOEXEC|O_NOCTTY); - assert_se(fd >= 0); - - assert_se(fgetxattrat_fake(fd, "test", "user.foo", v, 3, 0) >= 0); - assert_se(memcmp(v, "bar", 3) == 0); - - safe_close(fd); - fd = open("/", O_RDONLY|O_DIRECTORY|O_CLOEXEC|O_NOCTTY); - assert_se(fd >= 0); - assert_se(fgetxattrat_fake(fd, "usr", "user.idontexist", v, 3, 0) == -ENODATA); - -cleanup: - assert_se(unlink(x) >= 0); - assert_se(rmdir(t) >= 0); -} - int main(int argc, char *argv[]) { log_parse_environment(); log_open(); @@ -321,7 +288,6 @@ int main(int argc, char *argv[]) { test_log2i(); test_execute_directory(); test_raw_clone(); - test_fgetxattrat_fake(); return 0; } -- cgit v1.2.3-54-g00ecf