@@ -67,6 +67,9 @@ usage: test/env [-cDhiKr] -f <IMAGE> -q <QENETH-DIR> <COMMAND> [<ARGS>...]
6767 topology. If the command is containerized, it will be launched
6868 in the host's network namespace
6969
70+ -v <VERSION>
71+ Version of the image under test.
72+
7073EOF
7174}
7275
@@ -78,6 +81,12 @@ get_base_img()
7881 echo " $envdir /qeneth/$( basename " $base_img_file " ) "
7982}
8083
84+ get_version ()
85+ {
86+ local file=" $1 "
87+ unsquashfs -cat " $file " etc/os-release | awk -F' =' ' /^VERSION=/ {gsub(/"/, "", $2); print $2}'
88+ }
89+
8190start_topology ()
8291{
8392 qenethdir=" $1 "
@@ -154,7 +163,7 @@ containerize=yes
154163files=
155164basedir=" $ixdir "
156165
157- while getopts " b:cCDf:hiKp:q:rt:" opt; do
166+ while getopts " b:cCDf:hiKp:q:rt:v: " opt; do
158167 case ${opt} in
159168 b)
160169 basedir=" $OPTARG "
@@ -198,6 +207,9 @@ while getopts "b:cCDf:hiKp:q:rt:" opt; do
198207 network=" --network host --volume $topology :$topology :ro"
199208 runners=" docker podman"
200209 ;;
210+ v)
211+ version=" $OPTARG "
212+ ;;
201213 * )
202214 >&2 echo " Unknown option -$opt "
203215 usage
@@ -234,6 +246,7 @@ if [ "$containerize" ]; then
234246 --env NINEPM_PROJ_CONFIG=" $NINEPM_PROJ_CONFIG " \
235247 --env QENETH_PATH=" $testdir /templates:$testdir " \
236248 --env PS1=" $( build_ps1) " \
249+ --env VERSION=" $version " \
237250 $extra_env \
238251 --expose 9001-9010 --publish-all \
239252 -v " $HOME /.infix/.ash_history" :/root/.ash_history \
0 commit comments