Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testsuite: Retry logic for final cleanup step in test358 #1797

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading