Skip to content

Commit

Permalink
testsuite: Retry logic for final cleanup step in test358, GitHub #1795
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Dec 1, 2024
1 parent e8e567a commit 8aa5e1c
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions test/testsuite/FPSetFileDirParms.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,8 +889,10 @@ uint16_t bitmap = 0;
uint16_t vol2;
uint8_t old_access[4];
DSI *dsi2;

DSI *dsi;
int maxattempts = 10;
int attempt = 0;
int ret;

dsi = &Conn->dsi;

Expand Down Expand Up @@ -944,11 +946,27 @@ DSI *dsi;
FAIL (FPSetDirParms(Conn, vol, dir , "", bitmap, &filedir))

fin:
FPDelete(Conn, vol, dir , name);
FPDelete(Conn, vol, dir , name1);
// FIXME: A more sophisticated way to ensure that the files have been deleted
sleep(2);
FAIL (FPDelete(Conn, vol, dir , ""))
FAIL (FPDelete(Conn, vol, dir, name))
FAIL (FPDelete(Conn, vol, dir, name1))

while (attempt < maxattempts) {
ret = FPDelete(Conn, vol, dir, "");
if (ret == AFP_OK) {
if (!Quiet) {
printf("FPDelete succeeded on attempt %d\n", attempt + 1);
}
break;
} else if (!Quiet) {
printf("FPDelete failed on attempt %d\n", attempt + 1);
}
attempt++;
sleep(1);
}

if (ret != AFP_OK) {
test_failed();
}

test_exit:
exit_test("FPSetFileDirParms:test358: set unix access privilege two users");
}
Expand Down

0 comments on commit 8aa5e1c

Please sign in to comment.