Skip to content

Commit

Permalink
Smoke tests improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mprimi committed Jun 29, 2022
1 parent 421db3c commit 8048a38
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions smoke-tests/test-autoreceive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RECEIVER_TAG=foobar
${NASEFA} auto-receive ${TEMPDIR} ${RECEIVER_TAG} some-tag some-other-tag &
RECEIVE_PID=${!}
log_debug "Started auto-receiver, PID: ${RECEIVE_PID}"
trap "kill -9 ${RECEIVE_PID} || echo" EXIT

BUNDLE_NAME="send-autoreceive-test-$((RANDOM))"
F1=theplague.png
Expand Down
6 changes: 4 additions & 2 deletions smoke-tests/test-web-send-receive-whitespace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,26 @@ source ${SCRIPT_DIR}/util.sh
BUNDLE_NAME="web-send-receive-test-whitespace-$((RANDOM))"
F1=README.md
F1_WITH_SPACES="READ ME.md"
F1_URL_ENCODED="READ%20ME.md"

# Create a file with spaces in name
cp ${NASEFA_ROOT}/${F1} "${TEMPDIR}/${F1_WITH_SPACES}"


PORT=8081

${NASEFA} web -bindAddr ":${PORT}" &
${NASEFA} web -allowBundlesListing -bindAddr ":${PORT}" &
WEB_PID=${!}
log_debug "Started web, PID: ${WEB_PID}"
trap "kill -9 ${WEB_PID} || echo" EXIT

${NASEFA} create -bundleName ${BUNDLE_NAME}
log_debug "Bundle created: ${BUNDLE_NAME}"

curl -s -F "file1=@${TEMPDIR}/${F1_WITH_SPACES}" http://localhost:${PORT}/upload/${BUNDLE_NAME} >/dev/null || fail "Failed to upload files"
log_debug "Uploaded 1 file with spaces"

curl -s "http://localhost:${PORT}/bundle/${BUNDLE_NAME}/${F1_WITH_SPACES}" > ${TEMPDIR}/${F1} || fail "Failed to download file"
curl -s "http://localhost:${PORT}/bundle/${BUNDLE_NAME}/${F1_URL_ENCODED}" > ${TEMPDIR}/${F1} || fail "Failed to download file"
log_debug "Downloaded 1 file (saved without spaces)"

kill ${WEB_PID}
Expand Down
3 changes: 2 additions & 1 deletion smoke-tests/test-web-send-receive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ F2=README.md

PORT=8081

${NASEFA} web -bindAddr ":${PORT}" &
${NASEFA} web -allowBundlesListing -bindAddr ":${PORT}" &
WEB_PID=${!}
log_debug "Started web, PID: ${WEB_PID}"
trap "kill -9 ${WEB_PID} || echo" EXIT

${NASEFA} create -bundleName ${BUNDLE_NAME}
log_debug "Bundle created: ${BUNDLE_NAME}"
Expand Down

0 comments on commit 8048a38

Please sign in to comment.