Skip to content

Commit 4f94d60

Browse files
rkanterwilfred-s
authored andcommitted
CDH-71625,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) (cherry picked from commit 2a6b626) ==C5_APPROVED_BUGFIX== Change-Id: Ia887c18884499429b17615a61c81510b18413c25 (cherry picked from commit 703b1b4ff6629dba971e66228f1aa1e464774ebc)
1 parent 400a7e6 commit 4f94d60

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
@@ -816,19 +816,23 @@ void test_trim_function() {
816816
free(trimmed);
817817
}
818818

819+
int is_empty(char *name);
820+
819821
void test_is_empty() {
820822
printf("\nTesting is_empty function\n");
821823
if (is_empty("/")) {
822824
printf("FAIL: / should not be empty\n");
823825
exit(1);
824826
}
825-
if (is_empty("/tmp/2938rf2983hcqnw8ud/noexist")) {
826-
printf("FAIL: /tmp/2938rf2983hcqnw8ud/noexist should not exist\n");
827+
char *noexist = TEST_ROOT "/noexist";
828+
if (is_empty(noexist)) {
829+
printf("%s should not exist\n", noexist);
827830
exit(1);
828831
}
829-
mkdir("/tmp/2938rf2983hcqnw8ud/emptydir", S_IRWXU);
830-
if (!is_empty("/tmp/2938rf2983hcqnw8ud/emptydir")) {
831-
printf("FAIL: /tmp/2938rf2983hcqnw8ud/emptydir be empty\n");
832+
char *emptydir = TEST_ROOT "/emptydir";
833+
mkdir(emptydir, S_IRWXU);
834+
if (!is_empty(emptydir)) {
835+
printf("FAIL: %s should be empty\n", emptydir);
832836
exit(1);
833837
}
834838
}

0 commit comments

Comments
 (0)