diff --git a/tests/Makefile.am b/tests/Makefile.am index 6ea867edbd24021b5ef8c425c4de3640be5d156f..eed692c8e7c6334c0263d6c306a8f539e14d0c2a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -196,7 +196,7 @@ mio-config-PM1.yaml: generate-mio-config.sh ./generate-mio-config.sh 102 && mv mio-config.yaml $@ mio-config-PM2.yaml: generate-mio-config.sh ./generate-mio-config.sh 103 && mv mio-config.yaml $@ -mio-config-PM2.yaml: generate-mio-config.sh +mio-config-PM3.yaml: generate-mio-config.sh ./generate-mio-config.sh 104 && mv mio-config.yaml $@ mio-config-C1.yaml: generate-mio-config.sh ./generate-mio-config.sh 105 && mv mio-config.yaml $@ diff --git a/tests/generate-mio-config.sh b/tests/generate-mio-config.sh index b0fbcfc8897645bf5f197badcbae2be24eef75a4..a20deb46b0f5310f2fa93e3186e0f757e671f42e 100755 --- a/tests/generate-mio-config.sh +++ b/tests/generate-mio-config.sh @@ -8,9 +8,18 @@ if test $# -ne 1; then exit 1 fi -MERO_HA_IP=`grep 'M0_CST_HA' /etc/mero/conf.xc |sed -s 's/^.*@M0_CST_HA.* "\([^"]*\)".*$/\1/'` -CLOVIS_IP=`grep 'M0_CST_CONFD' /etc/mero/conf.xc |sed -s 's/^.*@M0_CST_CONFD.* "\([^"]*\)".*$/\1/'|sed -s "s/\(.*\):1$/\1:$1/"` HOSTNAME=`hostname` +if test -f /etc/mero/conf.xc; then + # fetch from file (mainly for single-host installation) + MERO_HA_IP=`grep 'M0_CST_HA' /etc/mero/conf.xc |sed -s 's/^.*@M0_CST_HA.* "\([^"]*\)".*$/\1/'` + CLOVIS_IP=`grep 'M0_CST_CONFD' /etc/mero/conf.xc |sed -s 's/^.*@M0_CST_CONFD.* "\([^"]*\)".*$/\1/'|sed -s "s/\(.*\):1$/\1:$1/"` +else + # find the full address of the CST_HA service on the host we're running on + MERO_HA_IP=`hctl mero status | grep -2 CST_HA|grep -2 "$HOSTNAME" |head -2|tail -1|sed -e 's/^.*\[[^]]\+] [^ ]\+:[^ ]\+ \+\([^ ]\+\).*$/\1/'` + # find the part of the local clovis service address that we stick our mero-id onto + CLOVIS_IP=`hctl mero status | grep -A10 "$HOSTNAME" |grep -A1 CST_RMS|grep -v CST_RMS|head -1|sed -e 's/^.*\[[^]]\+] [^ ]\+:[^ ]\+ \+\([^ ]\+\).*$/\1/' | sed -e 's/\(.*\):[0-9]\+ $/\1:$1/'` +endif + cat >mio-config.yaml <<EOF # auto-generated MIO config file for $HOSTNAME