Skip to content

Commit

Permalink
Explicitly run everything out of default directory
Browse files Browse the repository at this point in the history
Signed-off-by: imjoey <majunjiev@gmail.com>
  • Loading branch information
imjoey committed Jan 4, 2021
1 parent b891c9b commit 28e1ce2
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions api/test/shell/cli_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,23 @@ clean_up

# run with -p flag out of the default directory
workDir=$(pwd)
rm -fr bin && mkdir bin
cp ./manager-api ./bin/
rm -rf html && mkdir html
cd html
echo "hi~" >> index.html
$workDir/bin/manager-api -p $workDir &
distDir=/tmp/manager-api
cp -r $workDir $distDir
cd $distDir
rm -fr bin && mkdir bin && mv ./manager-api ./bin/
rm -rf html && mkdir html && echo "hi~" >> html/index.html
cd bin && ./manager-api -p $distDir &
sleep 5

res=$(curl http://127.0.0.1:9000)
pkill -f manager-api
cd $workDir
rm -rf bin
rm -rf html
rm -fr $distDir

if [[ $res != "hi~" ]]; then
echo "failed: manager-api can't run with -p flag out of the default directory"
exit 1
fi
cd $workDir
clean_up

# test start info
Expand Down

0 comments on commit 28e1ce2

Please sign in to comment.