mirrord icon indicating copy to clipboard operation
mirrord copied to clipboard

Add e2e tests for a bash script

Open eyalb181 opened this issue 2 years ago • 1 comments

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 avatar Jul 11 '22 09:07 eyalb181

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 avatar Aug 15 '22 10:08 DmitryDodzin