Skip to content

Commit

Permalink
Start server automatically during tests. (uperf#63)
Browse files Browse the repository at this point in the history
* Start server automatically during tests.

Fixes uperf#32

* Update github actions to not start uperf server
  • Loading branch information
realneel committed Apr 11, 2023
1 parent 41ee8ad commit 4afed34
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,5 @@ jobs:
run: ./configure
- name: make
run: make
- name: start localhost server
run: ./src/uperf -s &
- name: start localhost server for vsock
run: ./src/uperf -s -S vsock &
- name: make check
run: make check
19 changes: 18 additions & 1 deletion tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,24 @@ if [[ "$profile" == *".vsock.xml" ]]; then
fi
fi

# Start server
serverpid=""
if pgrep uperf ; then
echo "uperf server already running; please stop it and try again"
exit
else
echo "Starting server - $uperf -s $csocket"
$uperf -s $csocket &
serverpid=$!
fi

echo h=$host duration=10s $uperf $csocket -m $profile >>log
h=$host duration=10s $uperf $csocket -m $profile >> log 2>&1
exitstatus=$?


# kill server
if [[ serverpid != "" ]] ; then
echo "Killing $serverpid"
kill -9 $serverpid
fi
exit $exitstatus

0 comments on commit 4afed34

Please sign in to comment.