From: Stefan Kobza Date: Tue, 19 Apr 2016 12:37:20 +0000 (+0200) Subject: Make dut_setup.sh verbose; add sleep after vpp restart. X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=commitdiff_plain;h=8e37725ead0a812ae4474ffba4ef120fd5ca9662 Make dut_setup.sh verbose; add sleep after vpp restart. - there's a race condition between VPP service restart and vpp_api_test execution; this patch addresses it with (for now) sleep after service vpp restart - above is just a workaround until VPP provides us with a notification of readiness.. Change-Id: I1f92c1d86e4f90c9432ea57c1747629f619f003e Signed-off-by: Stefan Kobza --- diff --git a/resources/libraries/bash/dut_setup.sh b/resources/libraries/bash/dut_setup.sh index c6bd0fbbe2..7069e5e608 100644 --- a/resources/libraries/bash/dut_setup.sh +++ b/resources/libraries/bash/dut_setup.sh @@ -12,50 +12,41 @@ # See the License for the specific language governing permissions and # limitations under the License. -echo -echo List vpp packages -echo -dpkg -l vpp\* +function cmd { + echo + echo "[Command_start_exec] '$1'" + echo -n "[Command_outputs] " + eval ${@} + echo "[Command_done_exec] '$1'" + echo +} echo -echo See vpp process -echo -ps aux | grep vpp +echo "[Command_desc] Starting ${0}" -echo -echo See /etc/vpp/startup.conf -echo -cat /etc/vpp/startup.conf +cmd 'dpkg -l vpp\*' -echo -echo Restart VPP -echo -sudo -S service vpp restart +cmd 'ps aux | grep vpp' -echo -echo List /proc/meminfo -echo -cat /proc/meminfo +cmd 'cat /etc/vpp/startup.conf' -echo -echo See free memory -echo -free -m +cmd 'sudo -S service vpp restart' + +echo "[Command_desc] SLEEP for three seconds, so that VPP is up for sure" +cmd 'sleep 3' + +cmd 'cat /proc/meminfo' + +cmd 'free -m' + +cmd 'ps aux | grep vpp' + +cmd 'sudo dmidecode | grep UUID' + +cmd 'lspci -Dnn' + +cmd 'tail -n 50 /var/log/syslog' + +echo "[Command_desc] Adding dpdk-input trace" +cmd 'sudo vpp_api_test <<< "exec trace add dpdk-input 100"' -echo -echo See vpp process -echo -ps aux | grep vpp - -echo UUID -sudo dmidecode | grep UUID - -echo Add dpdk-input trace -sudo vpp_api_test <<< "exec trace add dpdk-input 100" -RESULT=$? -if [ $RESULT -ne 0 ]; then - echo - echo See /var/log/syslog - sudo tail -n 200 /var/log/syslog - exit $RESULT -fi