Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
margo
Commits
c839222b
Commit
c839222b
authored
Oct 11, 2016
by
Philip Carns
Browse files
test case for using dedicated pool for progress
parent
3d559909
Changes
3
Hide whitespace changes
Inline
Side-by-side
tests/Makefile.subdir
View file @
c839222b
...
...
@@ -12,14 +12,17 @@ check_PROGRAMS += \
TESTS
+=
\
tests/sleep.sh
\
tests/basic.sh
\
tests/basic-ded-pool.sh
\
tests/timeout.sh
EXTRA_DIST
+=
\
tests/sleep.sh
\
tests/basic.sh
\
tests/basic-ded-pool.sh
\
tests/timeout.sh
\
tests/test-util.sh
\
tests/test-util-hang.sh
tests/test-util-hang.sh
\
tests/test-util-ded-pool.sh
tests_server_SOURCES
=
\
tests/server.c
\
...
...
tests/basic-ded-pool.sh
0 → 100755
View file @
c839222b
#!/bin/bash -x
# NOTE: this example uses a dedicated execution stream in Argobots to drive
# progress on the server
if
[
-z
$srcdir
]
;
then
echo
srcdir variable not set.
exit
1
fi
source
$srcdir
/tests/test-util-ded-pool.sh
# start 1 server with 2 second wait, 20s timeout
test_start_servers 1 2 20
sleep
1
#####################
# run client test, which will also shut down server when done
run_to 10 tests/client
$svr1
&> /dev/null
if
[
$?
-ne
0
]
;
then
wait
exit
1
fi
#####################
wait
exit
0
tests/test-util-ded-pool.sh
0 → 100644
View file @
c839222b
#
# General test script utilities
#
if
[
-z
"
$TIMEOUT
"
]
;
then
echo
expected TIMEOUT variable defined to its respective
command
exit
1
fi
function
run_to
()
{
maxtime
=
${
1
}
s
shift
$TIMEOUT
--signal
=
9
$maxtime
"
$@
"
}
function
test_start_servers
()
{
nservers
=
${
1
:-
4
}
startwait
=
${
2
:-
15
}
maxtime
=
${
3
:-
120
}
s
repfactor
=
${
4
:-
0
}
pid
=
$$
startport
=
3344
endport
=
`
expr
3344 +
$nservers
- 1
`
# start daemons
for
i
in
`
seq
$startport
$endport
`
do
$TIMEOUT
--signal
=
9
${
maxtime
}
tests/server tcp://
$i
&
if
[
$?
-ne
0
]
;
then
# TODO: this doesn't actually work; can't check return code of
# something executing in background. We have to rely on the
# return codes of the actual client side tests to tell if
# everything started properly
exit
1
fi
done
# wait for servers to start
sleep
${
startwait
}
svr1
=
"tcp://localhost:
$startport
"
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment