mirrord
mirrord copied to clipboard
Add e2e tests for a bash script
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.
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)