Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit d6ba3161 authored by lavocat's avatar lavocat
Browse files

Make all tests pass without launcher

Use Yggdrasil when it's installed on the computer via PIP.
./regresseion.sh will allow to test the program.
parent e371bf5b
#!/bin/bash
base=$PWD
export PATH=$PATH:$base:$base/isengard:$base/erebor:$base/task_lib
export PYTHONPATH=$base:$base/isengard:$base/erebor:$base/task_lib
echo -------------------------------------------------------------------------
echo -- INIT LAUNCHER
echo -------------------------------------------------------------------------
if command -v taktuk >/dev/null; then
echo taktuk is installed
else
s=0
for i in "$@" ; do
if [[ $i == "-P" ]] ; then
s=1
fi
done
if [[ $s == 0 ]] ; then
echo taktuk is not installed, specify its path with option -P
echo or install it with 'sudo aptitude install taktuk'
exit -1
fi
fi
base=$(pwd)
pgm="$1"
shift
echo -------------------------------------------------------------------------
echo -- START
echo -------------------------------------------------------------------------
./$pgm -p $base $@
#!/bin/bash #!/bin/bash
echo #echo
echo -- Testing packing : #echo -- Testing packing :
#
if ./launcher ./erebor/encoder.py #if ./erebor/encoder.py
then #then
echo packing OK # echo packing OK
else #else
echo packing NOK # echo packing NOK
exit 1 # exit 1
fi #fi
echo echo
echo -- Testing failing groups : echo -- Testing failing groups :
time ./launcher tests/fail_group.py > regression/fail_group_test time tests/fail_group.py > regression/fail_group_test
echo echo
if diff <(sort regression/fail_group_base) <(sort regression/fail_group_base) if diff <(sort regression/fail_group_base) <(sort regression/fail_group_base)
then then
...@@ -26,7 +26,7 @@ fi ...@@ -26,7 +26,7 @@ fi
echo echo
echo -- Testing basic task processor : echo -- Testing basic task processor :
time ./launcher tests/simple_task.py > regression/simple_task_test time tests/simple_task.py > regression/simple_task_test
echo echo
if diff <(sed "/.*[B|A]-/d" <(sort regression/simple_task_base)) <(sed "/.*[B|A]-/d" <(sort regression/simple_task_test)) if diff <(sed "/.*[B|A]-/d" <(sort regression/simple_task_base)) <(sed "/.*[B|A]-/d" <(sort regression/simple_task_test))
then then
...@@ -39,7 +39,7 @@ fi ...@@ -39,7 +39,7 @@ fi
echo echo
echo -- Testing mpi jail: echo -- Testing mpi jail:
time ./launcher tests/mpi_jail_task.py > regression/mpi_jail_task_test time tests/mpi_jail_task.py > regression/mpi_jail_task_test
echo echo
if diff <(sed "/status/d" <(sort regression/mpi_jail_task_base)) <(sed "/status/d" <(sort regression/mpi_jail_task_test)) if diff <(sed "/status/d" <(sort regression/mpi_jail_task_base)) <(sed "/status/d" <(sort regression/mpi_jail_task_test))
then then
...@@ -52,7 +52,7 @@ fi ...@@ -52,7 +52,7 @@ fi
echo echo
echo -- Testing basic sample : echo -- Testing basic sample :
time ./launcher tests/sample.py > regression/sample_test time tests/sample.py > regression/sample_test
echo echo
if diff <(sed "/uptime/d" <(sort regression/sample_base)) <(sed "/uptime/d" <(sort regression/sample_test)) if diff <(sed "/uptime/d" <(sort regression/sample_base)) <(sed "/uptime/d" <(sort regression/sample_test))
then then
...@@ -66,7 +66,7 @@ echo ...@@ -66,7 +66,7 @@ echo
echo echo
echo -- Testing broadcast : echo -- Testing broadcast :
time ./launcher tests/grid5ktest.py --host-list=A,A,A,A > regression/grid5ktest_test time tests/grid5ktest.py --host-list=A,A,A,A > regression/grid5ktest_test
echo echo
if diff <(sed "/done/d" <(sort regression/grid5ktest_test)) <(sed "/done/d" <(sort regression/grid5ktest_base)) if diff <(sed "/done/d" <(sort regression/grid5ktest_test)) <(sed "/done/d" <(sort regression/grid5ktest_base))
then then
...@@ -80,7 +80,7 @@ echo ...@@ -80,7 +80,7 @@ echo
echo echo
echo -- Testing replication : echo -- Testing replication :
time ./launcher tests/grid5kSlowGrouptest.py --host-list=A,A,A,A > regression/grid5kSlowGrouptest_test time tests/grid5kSlowGrouptest.py --host-list=A,A,A,A > regression/grid5kSlowGrouptest_test
echo echo
if diff <( sed '/{.*}/d' <(sed "/to wait/d" <(sort regression/grid5kSlowGrouptest_test))) <( sed '/{.*}/d' <(sed "/to wait/d" <(sort regression/grid5kSlowGrouptest_base))) if diff <( sed '/{.*}/d' <(sed "/to wait/d" <(sort regression/grid5kSlowGrouptest_test))) <( sed '/{.*}/d' <(sed "/to wait/d" <(sort regression/grid5kSlowGrouptest_base)))
then then
...@@ -94,7 +94,7 @@ echo ...@@ -94,7 +94,7 @@ echo
echo echo
echo -- Testing replication and routing : echo -- Testing replication and routing :
time ./launcher tests/grid5kGrouptest.py --host-list=A,A,A,A > regression/grid5kGrouptest_test time tests/grid5kGrouptest.py --host-list=A,A,A,A > regression/grid5kGrouptest_test
echo echo
if diff <( sed '/{.*}/d' <(sed "/to wait/d" <(sort regression/grid5kGrouptest_test))) <( sed '/{.*}/d' <(sed "/to wait/d" <(sort regression/grid5kGrouptest_base))) if diff <( sed '/{.*}/d' <(sed "/to wait/d" <(sort regression/grid5kGrouptest_test))) <( sed '/{.*}/d' <(sed "/to wait/d" <(sort regression/grid5kGrouptest_base)))
then then
...@@ -108,7 +108,7 @@ echo ...@@ -108,7 +108,7 @@ echo
echo echo
echo -- Testing simple emulated mpi communications : echo -- Testing simple emulated mpi communications :
time ./launcher tests/simple_mpi_communicator_test.py > regression/simple_mpi_test time tests/simple_mpi_communicator_test.py > regression/simple_mpi_test
echo echo
if diff <(sed "/with status/d" <(sort regression/simple_mpi_test)) <(sed "/with status/d" <(sort regression/simple_mpi_base)) if diff <(sed "/with status/d" <(sort regression/simple_mpi_test)) <(sed "/with status/d" <(sort regression/simple_mpi_base))
then then
...@@ -122,7 +122,7 @@ echo ...@@ -122,7 +122,7 @@ echo
echo echo
echo -- Testing emulated mpi communications : echo -- Testing emulated mpi communications :
time ./launcher tests/mpi_communicator_test.py > regression/mpi_test time tests/mpi_communicator_test.py > regression/mpi_test
echo echo
if diff <(sed "/with status/d" <(sort regression/mpi_test)) <(sed "/with status/d" <(sort regression/mpi_base)) if diff <(sed "/with status/d" <(sort regression/mpi_test)) <(sed "/with status/d" <(sort regression/mpi_base))
then then
...@@ -135,7 +135,7 @@ fi ...@@ -135,7 +135,7 @@ fi
echo echo
echo -- Testing emulated mpi communications with C programms: echo -- Testing emulated mpi communications with C programms:
time ./launcher tests/c_communicator_test.py > regression/c_communicator_test_test time tests/c_communicator_test.py > regression/c_communicator_test_test
echo echo
if diff <(sed "/with status/d" <(sort regression/c_communicator_test_test)) <(sed "/with status/d" <(sort regression/c_communicator_test_base)) if diff <(sed "/with status/d" <(sort regression/c_communicator_test_test)) <(sed "/with status/d" <(sort regression/c_communicator_test_base))
then then
......
-------------------------------------------------------------------------
-- INIT LAUNCHER
-------------------------------------------------------------------------
taktuk is installed
-------------------------------------------------------------------------
-- START
-------------------------------------------------------------------------
start start
path None path None
......
-------------------------------------------------------------------------
-- INIT LAUNCHER
-------------------------------------------------------------------------
taktuk is installed
-------------------------------------------------------------------------
-- START
-------------------------------------------------------------------------
start start
path None path None
processor start processor start
......
-------------------------------------------------------------------------
-- INIT LAUNCHER
-------------------------------------------------------------------------
taktuk is installed
-------------------------------------------------------------------------
-- START
-------------------------------------------------------------------------
start start
path None path None
......
-------------------------------------------------------------------------
-- INIT LAUNCHER
-------------------------------------------------------------------------
taktuk is installed
-------------------------------------------------------------------------
-- START
-------------------------------------------------------------------------
start start
path None path None
......
-------------------------------------------------------------------------
-- INIT LAUNCHER
-------------------------------------------------------------------------
taktuk is installed
-------------------------------------------------------------------------
-- START
-------------------------------------------------------------------------
start start
path None path None
......
-------------------------------------------------------------------------
-- INIT LAUNCHER
-------------------------------------------------------------------------
taktuk is installed
-------------------------------------------------------------------------
-- START
-------------------------------------------------------------------------
start start
path None path None
......
-------------------------------------------------------------------------
-- INIT LAUNCHER
-------------------------------------------------------------------------
taktuk is installed
-------------------------------------------------------------------------
-- START
-------------------------------------------------------------------------
start start
path None path None
processor start processor start
......
-------------------------------------------------------------------------
-- INIT LAUNCHER
-------------------------------------------------------------------------
taktuk is installed
-------------------------------------------------------------------------
-- START
-------------------------------------------------------------------------
start start
path None path None
......
-------------------------------------------------------------------------
-- INIT LAUNCHER
-------------------------------------------------------------------------
taktuk is installed
-------------------------------------------------------------------------
-- START
-------------------------------------------------------------------------
start start
path None path None
......
-------------------------------------------------------------------------
-- INIT LAUNCHER
-------------------------------------------------------------------------
taktuk is installed
-------------------------------------------------------------------------
-- START
-------------------------------------------------------------------------
start start
path None path None
processor start processor start
......
...@@ -44,7 +44,7 @@ class MPIComTest(FrameworkControler): ...@@ -44,7 +44,7 @@ class MPIComTest(FrameworkControler):
# make it start a mpi session # make it start a mpi session
def mpi_session_started(data) : def mpi_session_started(data) :
print("executing the client") print("executing the client")
cmd = os.environ["PWD"]+"/../c_wrapper/server" cmd = os.environ["PWD"]+"/c_wrapper/server"
command = "{} -N {} -P 6000 -C {}".format(cmd, "server", (nb_jobs*nb_process)) command = "{} -N {} -P 6000 -C {}".format(cmd, "server", (nb_jobs*nb_process))
self.exec_on("0", command, consts.TRUE, "0", "server", "0", "root", self.server_end) self.exec_on("0", command, consts.TRUE, "0", "server", "0", "root", self.server_end)
for i in range(0, nb_jobs) : for i in range(0, nb_jobs) :
...@@ -57,7 +57,7 @@ class MPIComTest(FrameworkControler): ...@@ -57,7 +57,7 @@ class MPIComTest(FrameworkControler):
def start_clients(self, nb_process, port_server, rank) : def start_clients(self, nb_process, port_server, rank) :
i = int(rank) i = int(rank)
cmd = os.environ["PWD"]+"/../c_wrapper/client" cmd = os.environ["PWD"]+"/c_wrapper/client"
port_client = int(port_server + ((i+1)*nb_process)) port_client = int(port_server + ((i+1)*nb_process))
port_client += 1 port_client += 1
group_name = "client{}".format(i) group_name = "client{}".format(i)
......
...@@ -15,7 +15,7 @@ class Sample(TaskProcessor): ...@@ -15,7 +15,7 @@ class Sample(TaskProcessor):
nb_clients = 10 nb_clients = 10
g1 = MPIJail("jail_server", 'server', '', '0', 'root') g1 = MPIJail("jail_server", 'server', '', '0', 'root')
server_jail = MPIExecutor('s1', server_jail = MPIExecutor('s1',
os.environ["PWD"]+"/../c_wrapper/server -C {}".format(nb_clients), os.environ["PWD"]+"/c_wrapper/server -C {}".format(nb_clients),
g1, True) g1, True)
server_jail.add_dependency_conjunction({g1:consts.RUNING}, True) server_jail.add_dependency_conjunction({g1:consts.RUNING}, True)
self.tasks.append(g1) self.tasks.append(g1)
...@@ -23,7 +23,7 @@ class Sample(TaskProcessor): ...@@ -23,7 +23,7 @@ class Sample(TaskProcessor):
for i in range(0, nb_clients) : for i in range(0, nb_clients) :
gc = MPIJail("jail_client{}".format(i), "client{}".format(i), '', '0', 'root') gc = MPIJail("jail_client{}".format(i), "client{}".format(i), '', '0', 'root')
client_jail = MPIExecutor("mpi_executor{}".format(i), client_jail = MPIExecutor("mpi_executor{}".format(i),
os.environ["PWD"]+"/../c_wrapper/client -R 1 -S {}".format("server"), os.environ["PWD"]+"/c_wrapper/client -R 1 -S {}".format("server"),
gc,True) gc,True)
client_jail.add_dependency_conjunction( client_jail.add_dependency_conjunction(
{gc:consts.RUNING,server_jail:consts.RUNING}, True) {gc:consts.RUNING,server_jail:consts.RUNING}, True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment