Commit 0594ac5c authored by Joanne Hugé's avatar Joanne Hugé

Update test-board-synchro

parent fe7bcdd0
#!/bin/bash #!/bin/bash
script_dir=$(dirname $(realpath $0))
usage() { usage() {
cat << ENDUSAGE cat << ENDUSAGE
Usage: $0 [-h] [-i USEC -c USEC -s] [-T] BOARD1_HOSTNAME BOARD2_HOSTNAME Usage: $0 [-h] [-i USEC -c USEC -s] [-T] BOARD1_HOSTNAME BOARD2_HOSTNAME
...@@ -66,19 +68,19 @@ echo "Starting ptp4l on master"; ...@@ -66,19 +68,19 @@ echo "Starting ptp4l on master";
killall ptp4l; killall ptp4l;
if [ -n "$software_ts" ]; then if [ -n "$software_ts" ]; then
./run-ptp4l -i enp1s0; $script_dir/run-ptp4l -i enp1s0;
./run-ptp4l -i enp2s0; $script_dir/run-ptp4l -i enp2s0;
else else
./run-ptp4l -i enp1s0 -H; $script_dir/run-ptp4l -i enp1s0 -H;
./run-ptp4l -i enp2s0 -H; $script_dir/run-ptp4l -i enp2s0 -H;
fi fi
echo "Starting ptp4l on slaves"; echo "Starting ptp4l on slaves";
./sudossh $board1 "killall ptp4l"; $script_dir/sudossh $board1 "killall ptp4l";
./sudossh $board2 "killall ptp4l"; $script_dir/sudossh $board2 "killall ptp4l";
./sudossh $board1 "run-ptp4l -s"; $script_dir/sudossh $board1 "run-ptp4l -s";
./sudossh $board2 "run-ptp4l -s"; $script_dir/sudossh $board2 "run-ptp4l -s";
echo "Waiting for ptp to take effect..."; echo "Waiting for ptp to take effect...";
...@@ -88,8 +90,8 @@ sleep 30; ...@@ -88,8 +90,8 @@ sleep 30;
#phc2sys -arrm &> ~/phc2sys1_log& #phc2sys -arrm &> ~/phc2sys1_log&
#phc2sys -arrm &> ~/phc2sys2log& #phc2sys -arrm &> ~/phc2sys2log&
./run-phc2sys -i enp1s0; $script_dir/run-phc2sys -i enp1s0;
./run-phc2sys -i enp2s0; $script_dir/run-phc2sys -i enp2s0;
echo "Waiting for phc2sys to take effect..."; echo "Waiting for phc2sys to take effect...";
...@@ -97,20 +99,20 @@ sleep 20; ...@@ -97,20 +99,20 @@ sleep 20;
echo "Start servers on slave"; echo "Start servers on slave";
./sudossh $board1 "setup_irqs"; $script_dir/sudossh $board1 "setup_irqs";
./sudossh $board2 "setup_irqs"; $script_dir/sudossh $board2 "setup_irqs";
./sudossh $board1 "killall server"; $script_dir/sudossh $board1 "killall server";
./sudossh $board2 "killall server"; $script_dir/sudossh $board2 "killall server";
if [ -n "$enable_tracing" ]; then if [ -n "$enable_tracing" ]; then
server_opts+=" -T $((interval*2)) -E \"-e irq -e sched -e net -e napi -e gpio\" -B 100000" server_opts+=" -T $((interval*2)) -E \"-e irq -e sched -e net -e napi -e gpio\" -B 100000"
fi fi
./exec-ssh-nohup $board1 "run-server -c $server_opts"; $script_dir/exec-ssh-nohup $board1 "run-server -c $server_opts";
./exec-ssh-nohup $board2 "run-server -c $server_opts"; $script_dir/exec-ssh-nohup $board2 "run-server -c $server_opts";
cd ../gettime/build; cd $script_dir/../gettime/build;
make; make;
time=$(./gettime -r -q) time=$(./gettime -r -q)
...@@ -121,11 +123,11 @@ time=$((time + 10000000000)) ...@@ -121,11 +123,11 @@ time=$((time + 10000000000))
echo "Start clients on master"; echo "Start clients on master";
cd ../../scripts; cd $script_dir;
if [ -z "$delay" ]; then if [ -z "$delay" ]; then
delay=$((interval / 2)) delay=$((interval / 2))
fi fi
./run-client -a 1 -q -i $interval -p -I enp1s0 -c $delay -s $time $board1 &> client_enp1s0_log& $script_dir/run-client -a 1 -q -i $interval -p -I enp1s0 -c $delay -s $time $board1 &> client_enp1s0_log&
./run-client -a 2 -q -i $interval -p -I enp2s0 -c $delay -s $time $board2 &> client_enp2s0_log& $script_dir/run-client -a 2 -q -i $interval -p -I enp2s0 -c $delay -s $time $board2 &> client_enp2s0_log&
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