aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/bash/dut_setup.sh
diff options
context:
space:
mode:
authorStefan Kobza <skobza@cisco.com>2016-04-19 14:37:20 +0200
committerStefan Kobza <skobza@cisco.com>2016-04-19 16:00:17 +0000
commit8e37725ead0a812ae4474ffba4ef120fd5ca9662 (patch)
treea654eb75eb87c7ea9b892cc716db612924a4188d /resources/libraries/bash/dut_setup.sh
parentc1bdb7115f12e7d4ec586ec0673fd19dce3a2414 (diff)
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 <skobza@cisco.com>
Diffstat (limited to 'resources/libraries/bash/dut_setup.sh')
-rw-r--r--resources/libraries/bash/dut_setup.sh71
1 files changed, 31 insertions, 40 deletions
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