Skip to content

Commit 4899969

Browse files
committed
fix(test_harness): python3 mock for config.py calls
1 parent e9bbd6c commit 4899969

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/test_harness.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,15 @@ fi
229229
make_mock findmnt 'echo ""'
230230
make_mock mountpoint 'exit 0'
231231
REAL_PYTHON3=$(command -v python3)
232-
cat > "${MOCK_BIN}/python3" <<MOCK
232+
cat > "${MOCK_BIN}/python3" <<'MOCK'
233233
#!/bin/bash
234234
for arg in "$@"; do
235-
[[ "$arg" == *config.py* ]] && exec ${REAL_PYTHON3} "$@"
235+
[[ "$arg" == *config.py* ]] && exec REAL_PYTHON3_PLACEHOLDER "$@"
236236
done
237237
exit 0
238238
MOCK
239+
sed -i "s|REAL_PYTHON3_PLACEHOLDER|${REAL_PYTHON3}|g" "${MOCK_BIN}/python3"
240+
chmod +x "${MOCK_BIN}/python3"
239241
make_mock mount 'exit 0'
240242
make_mock btrfs 'exit 0'
241243
make_mock flock 'exit 0'

0 commit comments

Comments
 (0)