Test suite for flex-grid support
[transportpce.git] / tests / Xtesting / DockerSims / dockercmd_profile.sh
1 #!/bin/sh
2
3 DEVICE_VERSION=${1:-all}
4
5 # this file centralizes inb one place parameters needed by docker scripts,
6 # more especially the image lists for 1.2.1 and 2.2.1 devices.
7 # device versions supported as scripts argument are 1.2.1 and 2.2.1 and "all"
8
9 #IMAGE_LIST format is suffix_port : container/image name : config file to fill netconf operational datastore
10
11 IMAGE121_LIST="30:xpdra-1.2.1:1.2.1/oper-XPDRA.xml
12 31:roadma-1.2.1:1.2.1/oper-ROADMA.xml
13 32:roadmb-1.2.1:1.2.1/oper-ROADMB.xml
14 33:roadmc-1.2.1:1.2.1/oper-ROADMC.xml
15 34:xpdrc-1.2.1:1.2.1/oper-XPDRC.xml
16 21:roadma-full-1.2.1:1.2.1/oper-ROADMA-full.xml
17 23:roadmc-full-1.2.1:1.2.1/oper-ROADMC-full.xml
18 "
19
20 IMAGE221_LIST="40:xpdra-2.2.1:2.2.1/oper-XPDRA.xml
21 41:roadma-2.2.1:2.2.1/oper-ROADMA.xml
22 42:roadmb-2.2.1:2.2.1/oper-ROADMB.xml
23 43:roadmc-2.2.1:2.2.1/oper-ROADMC.xml
24 47:roadmd-2.2.1:2.2.1/oper-ROADMD.xml
25 44:xpdrc-2.2.1:2.2.1/oper-XPDRC.xml
26 45:spdra-2.2.1:2.2.1/oper-SPDRA.xml
27 46:spdrc-2.2.1:2.2.1/oper-SPDRC.xml
28 25:spdra_no_interface-2.2.1:2.2.1/oper-SPDRA_no_interface.xml
29 "
30
31 case "$DEVICE_VERSION" in
32     "1.2.1") IMAGE_LIST=$IMAGE121_LIST
33     ;;
34     "2.2.1") IMAGE_LIST=$IMAGE221_LIST
35     ;;
36     "all") IMAGE_LIST=$IMAGE121_LIST" "$IMAGE221_LIST
37     ;;
38     *) echo "unsupported device version"
39     exit 1
40     ;;
41 esac
42
43 DOCKER_CMD=docker
44 DOCKER_IMAGE=honeynode:alpine-jre11
45 RESTCONF_USER=admin
46 RESTCONF_PASSWORD=admin
47 if [ `which podman` ]
48 then DOCKER_CMD=podman
49 else
50     if [ ! `which $DOCKER_CMD` ]
51     then  echo "no docker command available" >&2
52         exit 1
53     fi
54     #if "docker ps" cannot be run without error, prepend sudo
55     if ( ! $DOCKER_CMD ps >/dev/null 2>&1 );then
56         echo "docker command only usable as root, using sudo" >&2
57         DOCKER_CMD="sudo docker"
58     fi
59 fi
60
61