summaryrefslogtreecommitdiffstats
path: root/docker/test
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-11-24 14:24:53 +0100
committerMarek Gradzki <mgradzki@cisco.com>2017-11-27 07:22:42 +0100
commitfc838c481e6f588906f6282ee1891b4b98ab1779 (patch)
treec6f4e6854c500692ad08d85f6b9c259d2e8736df /docker/test
parent8f481756073847efaa6f54c6482b3850b3cd7535 (diff)
Various scripts for creating and connecting hc2vpp docker containers
Change-Id: I755a23ba279a84600edfa2ddef89c2fe645c7945 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'docker/test')
-rwxr-xr-xdocker/test/docker_ip.sh5
-rwxr-xr-xdocker/test/show_interfaces_state.sh15
2 files changed, 20 insertions, 0 deletions
diff --git a/docker/test/docker_ip.sh b/docker/test/docker_ip.sh
new file mode 100755
index 000000000..1e3bc997d
--- /dev/null
+++ b/docker/test/docker_ip.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+# Obtain IP address of the container
+# See http://blog.oddbit.com/2014/08/11/four-ways-to-connect-a-docker/
+docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$@"
diff --git a/docker/test/show_interfaces_state.sh b/docker/test/show_interfaces_state.sh
new file mode 100755
index 000000000..dc868dbea
--- /dev/null
+++ b/docker/test/show_interfaces_state.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# Obtain IP of the container
+# $1 - container name
+ip=$($(dirname $0)/docker_ip.sh $1)
+url="https://$ip:8445/restconf/operational/ietf-interfaces:interfaces-state/"
+echo "GET $url"
+
+# Show interfaces-state
+curl --insecure -X GET $url \
+ -H 'authorization: Basic YWRtaW46YWRtaW4=' \
+ -H 'cache-control: no-cache' \
+ -H 'content-type: application/json'
+
+echo