Skip to content

Commit 2a6b626

Browse files
rkantermiklosszegedi
authored andcommitted
YARN-8518. test-container-executor test_is_empty() is broken (Jim_Brennan via rkanter)
(cherry picked from commit 1bc106a) (cherry picked from commit 6e0db6f) (cherry picked from commit edb9d8b) (cherry picked from commit d9b9c91)
1 parent 560ecf9 commit 2a6b626

File tree

1 file changed

+9
-5
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/test

1 file changed

+9
-5
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/test/test-container-executor.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -995,19 +995,23 @@ void test_get_docker_binary() {
995995
free(docker_binary_user);
996996
}
997997

998+
int is_empty(char *name);
999+
9981000
void test_is_empty() {
9991001
printf("\nTesting is_empty function\n");
10001002
if (is_empty("/")) {
10011003
printf("FAIL: / should not be empty\n");
10021004
exit(1);
10031005
}
1004-
if (is_empty("/tmp/2938rf2983hcqnw8ud/noexist")) {
1005-
printf("FAIL: /tmp/2938rf2983hcqnw8ud/noexist should not exist\n");
1006+
char *noexist = TEST_ROOT "/noexist";
1007+
if (is_empty(noexist)) {
1008+
printf("%s should not exist\n", noexist);
10061009
exit(1);
10071010
}
1008-
mkdir("/tmp/2938rf2983hcqnw8ud/emptydir", S_IRWXU);
1009-
if (!is_empty("/tmp/2938rf2983hcqnw8ud/emptydir")) {
1010-
printf("FAIL: /tmp/2938rf2983hcqnw8ud/emptydir be empty\n");
1011+
char *emptydir = TEST_ROOT "/emptydir";
1012+
mkdir(emptydir, S_IRWXU);
1013+
if (!is_empty(emptydir)) {
1014+
printf("FAIL: %s should be empty\n", emptydir);
10111015
exit(1);
10121016
}
10131017
}

0 commit comments

Comments
 (0)