Skip to content

Commit

Permalink
tests: in_http: replaced the failure trigger mechanism
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <[email protected]>
  • Loading branch information
leonardo-albertovich authored and edsiper committed Aug 15, 2024
1 parent b494c29 commit 17379db
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/runtime/in_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,8 @@ void flb_test_http_failure_400_bad_disk_write()

flb_time_msleep(5000);

ret = chmod("/tmp/http-input-test-404-bad-write", 000);
rename("/tmp/http-input-test-404-bad-write",
"/tmp/http-input-test-404-bad-write.fail");
TEST_CHECK(ret == 0);

ctx->httpc = http_client_ctx_create();
Expand All @@ -574,11 +575,9 @@ void flb_test_http_failure_400_bad_disk_write()
TEST_MSG("http response code error. expect: %d, got: %d\n", 400, c->resp.status);
}

chmod("/tmp/http-input-test-404-bad-write/http.0", 0700);
rmdir("/tmp/http-input-test-404-bad-write/http.0");

chmod("/tmp/http-input-test-404-bad-write", 0700);
rmdir("/tmp/http-input-test-404-bad-write");
rename("/tmp/http-input-test-404-bad-write.fail",
"/tmp/http-input-test-404-bad-write");
TEST_CHECK(ret == 0);

/* waiting to flush */
flb_time_msleep(1500);
Expand Down

0 comments on commit 17379db

Please sign in to comment.