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

Add integration tests for a bash script #200

Open
eyalb181 opened this issue Jul 11, 2022 · 1 comment
Open

Add integration tests for a bash script #200

eyalb181 opened this issue Jul 11, 2022 · 1 comment
Labels
enhancement New feature or request tests

Comments

@eyalb181
Copy link
Member

A possible use case for mirrord is running commands in bash as if it's running in the remote pod. Please add e2e tests that verify file reads, file writes, and environment variables access work for a bash script run with mirrord.

  • Note - if the outgoing traffic feature has been implemented by the time development starts on this issue, then it should be tested here as well.
@eyalb181 eyalb181 added enhancement New feature or request good first issue Good for newcomers labels Jul 11, 2022
@DmitryDodzin
Copy link
Member

After some testing it appears that the simplest and most common way of testing if "file exist" uses a not yet supported sys-call faccessat

FILE=/etc/resolv.conf
if [ -f "$FILE" ]; then
    echo "$FILE exists."
fi

the [ -f "$FILE" ]; or test -f "$FILE"; are the culprits -> faccessat2(AT_FDCWD, "/etc/resolv.conf", R_OK, AT_EACCESS)

DmitryDodzin added a commit that referenced this issue Aug 16, 2022
)

Support hooks for access & faccessat only for absolute paths

Relevant for #200 and #137
DmitryDodzin added a commit that referenced this issue Aug 18, 2022
basic E2E tests running bash without file reads and writes

related: #200
@eyalb181 eyalb181 removed the good first issue Good for newcomers label Aug 19, 2022
@eyalb181 eyalb181 added the tests label Sep 19, 2022
@aviramha aviramha changed the title Add e2e tests for a bash script Oct 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tests
2 participants