Commit 485901f1 authored by Claes's avatar Claes Committed by Esteban Blanc

Docker tests updated

parent c200dd96
ARG RELEASE=debian:10
FROM $RELEASE
ARG BUILDVERSION
ARG BUILD_RPI
ARG GITREPO
ARG INSTALL_UPDATE
......@@ -18,7 +19,7 @@ RUN apt-get install -y xserver-xorg-video-dummy
RUN git clone $GITREPO
#RUN mv proview pwr;
RUN $INSTALL_BUILD
RUN ./build.sh $JDK_DIR
RUN ./build.sh $BUILDVERSION $JDK_DIR
RUN ./build_pwrdemo.sh
RUN ./build_pwrtest01.sh
RUN $INSTALL_RPI
......
#!/bin/bash
JDK_DIR=$1
BUILDVERSION=$1" "$2
JDK_DIR=$3
Xorg -noreset +extension GLX +extension RANDR +extension RENDER -config pwr/src/tools/dummy_display/xorg.conf :99 &
export DISPLAY=:99
export jdk=$JDK_DIR
touch /etc/proview.cnf
cd pwr
./build.sh
./build.sh --version $BUILDVERSION
ARG RELEASE=debian:10
FROM $RELEASE
ARG INSTALL_UPDATE
ARG INSTALL_PWR
ARG PKG_PWR
ARG PKG_PWRDEMO
COPY ./pwrdemo/test_pwrdemo.sh ./$PKG_PWR ./$PKG_PWRDEMO ./
RUN $INSTALL_UPDATE
RUN $INSTALL_PWR
RUN dpkg -i $PKG_PWR
COPY ./pwrdemo/test_pwrdemo.sh ./pkg/$PKG_PWRDEMO ./
RUN dpkg -i $PKG_PWRDEMO
RUN ./test_pwrdemo.sh
ARG RELEASE=debian:10
FROM $RELEASE
ARG INSTALL_UPDATE
ARG INSTALL_PWR
ARG PKG_PWR
ENV DISPLAY :1
ENV DEBIAN_FRONTEND none_interactive
COPY ./pkg/$PKG_PWR ./dummy_display_xorg.conf ./
RUN $INSTALL_UPDATE
RUN $INSTALL_PWR
RUN apt-get install -y xserver-xorg-video-dummy
RUN dpkg -i $PKG_PWR
ARG RELEASE=debian:10
FROM $RELEASE
ARG INSTALL_UPDATE
ARG INSTALL_PWRRT
ARG PKG_PWRRT
ENV DISPLAY :1
ENV DEBIAN_FRONTEND none_interactive
COPY ./pkg/$PKG_PWRRT ./dummy_display_xorg.conf ./
RUN $INSTALL_UPDATE
RUN $INSTALL_PWRRT
RUN apt-get install -y xserver-xorg-video-dummy
RUN dpkg -i $PKG_PWRRT
ARG RELEASE=debian:10
FROM $RELEASE
ENV DISPLAY :1
ENV DEBIAN_FRONTEND none_interactive
COPY ./pwrtest01/test_pwrtest01a.sh ./data/pwrp_pkg_pwrtest01a_0001.tgz ./
RUN mv ./pwrp_pkg_pwrtest01a_0001.tgz /home/pwrp/
CMD ./test_pwrtest01a.sh
ARG RELEASE=debian:10
FROM $RELEASE
ENV DISPLAY :1
ENV DEBIAN_FRONTEND none_interactive
COPY ./pwrtest01/test_pwrtest01b.sh ./data/pwrp_pkg_pwrtest01b_0001.tgz ./
RUN mv ./pwrp_pkg_pwrtest01b_0001.tgz /home/pwrp/
CMD ./test_pwrtest01b.sh
ARG RELEASE=debian:10
FROM $RELEASE
ENV DISPLAY :1
ENV DEBIAN_FRONTEND none_interactive
COPY ./pwrtest01/test_pwrtest01c.sh ./data/pwrp_pkg_pwrtest01c_0001.tgz ./
RUN mv ./pwrp_pkg_pwrtest01c_0001.tgz /home/pwrp/
RUN ./test_pwrtest01c.sh
#!/bin/bash
echo "Here in test_pwrtest01a.sh"
Xorg -noreset +extension GLX +extension RANDR +extension RENDER -config ./dummy_display_xorg.conf :99 &
sleep 20
su - pwrp
cd /home/pwrp
pwd
source .bashrc
export DISPLAY=:99
pwd
export PWR_BUS_ID=999
export PYTHONPATH=$pwr_exe
pwr_pkg.sh -i /home/pwrp/pwrp_pkg_pwrtest01a_0001.tgz
# Rename boot, node and plcfiles
nname=`eval uname -n`
bootfile=`eval ls -1 $pwrp_load/ld_boot*.dat`
nodefile=`eval ls -1 $pwrp_load/ld_node*.dat`
plcfile=`eval ls -1 $pwrp_exe/plc_*_0999_plc`
echo "alias pwrtest01a $nname 172.18.0.22" > $pwrp_load/pwrp_alias.dat
echo "alias pwrtest01b pwrtest01b 172.18.0.23" >> $pwrp_load/pwrp_alias.dat
#mv $plcfile $pwrp_exe/"plc_"$nname"_0999_plc"
# Start project
rt_ini -i -n pwrtest01a&
sleep 10
export PYTHONPATH=$pwr_exe
ra_testall_a.sh
sleep 3
\ No newline at end of file
#!/bin/bash
echo "Here in test_pwrtest01b.sh"
Xorg -noreset +extension GLX +extension RANDR +extension RENDER -config ./dummy_display_xorg.conf :99 &
sleep 20
su - pwrp
cd /home/pwrp
source .bashrc
export DISPLAY=:99
export PWR_BUS_ID=999
export PYTHONPATH=$pwr_exe
pwr_pkg.sh -i /home/pwrp/pwrp_pkg_pwrtest01b_0001.tgz
# Rename boot, node and plcfiles
nname=`eval uname -n`
bootfile=`eval ls -1 $pwrp_load/ld_boot*.dat`
nodefile=`eval ls -1 $pwrp_load/ld_node*.dat`
plcfile=`eval ls -1 $pwrp_exe/plc_*_0999_plc`
echo "alias pwrtest01b $nname 172.18.0.23" > $pwrp_load/pwrp_alias.dat
echo "alias pwrtest01a pwrtest01a 172.18.0.22" >> $pwrp_load/pwrp_alias.dat
#mv $plcfile $pwrp_exe/"plc_"$nname"_0999_plc"
# Start project
rt_ini -i -n pwrtest01b&
sleep 10
export PYTHONPATH=$pwr_exe
ra_testall_b.sh
sleep 5
\ No newline at end of file
#!/bin/bash
echo "Starting test_pwrtest01c.sh"
Xorg -noreset +extension GLX +extension RANDR +extension RENDER -config ./dummy_display_xorg.conf :99 &
sleep 20
su - pwrp
cd /home/pwrp
source .bashrc
export DISPLAY=:99
export PWR_BUS_ID=999
export PYTHONPATH=$pwr_exe
pwr_pkg.sh -i /home/pwrp/pwrp_pkg_pwrtest01c_0001.tgz
# Rename boot, node and plcfiles
nname=`eval uname -n`
bootfile=`eval ls -1 $pwrp_load/ld_boot*.dat`
nodefile=`eval ls -1 $pwrp_load/ld_node*.dat`
plcfile=`eval ls -1 $pwrp_exe/plc_*_0999_plc`
echo "alias pwrtest01c $nname 127.0.0.1" > $pwrp_load/pwrp_alias.dat
#mv $plcfile $pwrp_exe/"plc_"$nname"_0999_plc"
# Start project
rt_ini -i -n pwrtest01c&
sleep 10
export PYTHONPATH=$pwr_exe
ra_testall_c.sh
sleep 3
\ No newline at end of file
ARG RELEASE=debian:10
FROM $RELEASE
ARG INSTALL_UPDATE
ARG INSTALL_PWR
ARG PKG_PWR
ENV DISPLAY :1
ENV DEBIAN_FRONTEND none_interactive
COPY ./pwrtest02/create_project.sh ./pwrtest02/configure_cvolpwrtest02.pwr_com ./pwrtest02/configure_directory.pwr_com ./pwrtest02/configure_volpwrtest02.pwr_com ./pwrtest02.tar.gz ./pwrtest02/wa_testall.sh ./dummy_display_xorg.conf ./$PKG_PWR ./
RUN $INSTALL_UPDATE
RUN $INSTALL_PWR
RUN apt-get install -y python
RUN apt-get install -y make pkg-config
RUN apt-get install -y xserver-xorg-video-dummy
RUN dpkg -i $PKG_PWR
COPY ./pwrtest02/create_project.sh ./pwrtest02/configure_cvolpwrtest02.pwr_com ./pwrtest02/configure_directory.pwr_com ./pwrtest02/configure_volpwrtest02.pwr_com ./data/pwrtest02.tar.gz ./pwrtest02/wa_testall.sh ./dummy_display_xorg.conf ./
RUN ./create_project.sh create
This diff is collapsed.
my : demo_all
include $(pwr_exe)/pwrp_rules.mk
#asan = -fsanitize=address -lasan
demo_modules = $(pwrp_exe)/wa_ldhtest \
$(pwrp_exe)/wa_pwrwbtest.py \
$(pwrp_exe)/ra_test.py
pwre_conf_libpwrco=-lpwr_co
pwre_conf_libpwrrt=-lpwr_rt -lpwr_statussrv -lpwr_co -lpwr_msg_dummy
pwre_conf_libpwrdtt=-lpwr_dtt
pwre_conf_libpwrotherio=-lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_cifx_dummy -lpwr_nodave_dummy -lpwr_epl_dummy
pwre_conf_libpwrprofibus=-lpwr_pnak_dummy
pwre_conf_libpwrpowerlink=
pwre_conf_libpwrpowerlinkcn=
pwre_conf_libpwrxtt=-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow
pwre_conf_libpwrxttgtk= -lpwr_xtt_gtk -lpwr_ge_gtk -lpwr_cow_gtk -lpwr_flow_gtk -lpwr_glow_gtk
pwre_conf_libpwrxttqt= -lpwr_xtt_qt -lpwr_ge_qt -lpwr_cow_qt -lpwr_flow_qt -lpwr_glow_qt
pwre_conf_libpwrxttmotif= -lpwr_xtt_motif -lpwr_ge_motif -lpwr_cow_motif -lpwr_flow_motif -lpwr_glow_motif
pwre_conf_libpwrwb=-lpwr_wb
pwre_conf_libpwrwbgtk=-lpwr_wb_gtk
pwre_conf_libpwrwbqt=-lpwr_wb_qt
pwre_conf_libpwrwbmotif=-lpwr_wb_motif
pwre_conf_libpwropc=-lpwr_opc
pwre_conf_libpwrremote=-lpwr_remote
pwre_conf_libpwrnmps=-lpwr_nmps
pwre_conf_libpwrtlog=-lpwr_tlog
pwre_conf_libpwrsev=-lpwr_sev
pwre_conf_lib= -lrpcsvc -lasound -lpthread -lm -ldb -lz -lcrypt -lrt -lX11 -lsqlite3 -lhdf5_openmpi -lmpi -lrabbitmq -lusb-1.0 -lrsvg-2
pwre_conf_libwb= -ldb_cxx
pwre_conf_libmq=
pwre_conf_libwmq=
pwre_conf_libpnak=
pwre_conf_libgtk= \`pkg-config --libs gtk+-2.0\`
pwre_conf_libqt=
pwre_conf_libgst= \`pkg-config --libs gstreamer-video-1.0 gstreamer-1.0\`
wb_msg_eobjs=$(pwr_obj)/pwr_msg_wb.o
rt_msg_eobjs=$(pwr_obj)/pwr_msg_rt.o $(pwr_obj)/pwr_msg_rs.o $(pwr_obj)/pwr_msg_co.o $(pwr_obj)/pwr_msg_flow.o $(pwr_obj)/pwr_msg_glow.o $(pwr_obj)/pwr_msg_ge.o
demo_all : $(demo_modules)
$(pwrp_exe)/wa_ldhtest : $(pwrp_appl)/wa_ldhtest.cpp
@ echo "Building wa_ldhtest"
@ g++ -g -o $(target) $(source) -DOS_LINUX=1 -Wall -I$(pwr_inc) -I$(pwrp_inc) -L$(pwr_lib) \
$(wb_msg_eobjs) $(rt_msg_eobjs) $(pwre_conf_libdir) \
$(pwr_obj)/rt_io_user.o $(pwr_obj)/wb_procom.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrwbgtk) $(pwre_conf_libpwrxttgtk) \
$(pwre_conf_libpwrwb) \
$(pwre_conf_libpwrxtt) $(pwre_conf_libpwrwbgtk) $(pwre_conf_libpwrwb) \
$(pwre_conf_libpwrxttgtk) $(pwre_conf_libpwrxtt) \
`pkg-config --libs gtk+-2.0` \
$(pwre_conf_libpwrrt) $(pwre_conf_libwb) $(pwre_conf_lib) $(asan)
$(pwrp_exe)/wa_pwrwbtest.py : $(pwrp_appl)/wa_pwrwbtest.py
@ echo "Building wa_pwrwbtest"
@ cp -p $(source) $(target)
$(pwrp_exe)/ra_test.py : $(pwrp_appl)/ra_test.py
@ echo "Building ra_test"
@ cp -p $(source) $(target)
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
import sys
import math
import time
import pwrrt
import pwrtest
class Ctx:
#
# Static pwrrt methods
#
#
# pwrrt.init()
#
def init(self):
try:
pwrrt.init('ra_pwrrttest')
except RuntimeError as e:
self.logger.vlog('E', 'init, Unexpected exception %s', str(e))
raise e
self.logger.log('S', 'init, successfull completion')
#
# Check system status
#
def systemStatus(self):
a = pwrrt.attribute('Nodes-Pwrtest02.SystemStatus')
sts = a.value()
msg = pwrrt.getMsg(sts)
if sts % 2 == 0:
self.logger.log('E', 'System status', msg);
return
self.logger.log('S', 'System status', msg)
#
# Check plc threads
#
def plcThreads(self):
d = (
((1, 'PlcTest-H1-Dv1.ActualValue', 1),
(1, 'PlcTest-H1-Dv2.ActualValue', 1),
(1, 'PlcTest-H1-Dv3.ActualValue', 0),
(0, 'PlcTest-H1-Dv4.ActualValue', 1)),
((1, 'PlcTest-H2-Dv1.ActualValue', 1),
(1, 'PlcTest-H2-Dv2.ActualValue', 1),
(1, 'PlcTest-H2-Dv3.ActualValue', 0),
(0, 'PlcTest-H2-Dv4.ActualValue', 1)),
((1, 'PlcTest-H3-Dv1.ActualValue', 1),
(1, 'PlcTest-H3-Dv2.ActualValue', 1),
(1, 'PlcTest-H3-Dv3.ActualValue', 0),
(0, 'PlcTest-H3-Dv4.ActualValue', 1)),
((1, 'PlcTest-H4-Dv1.ActualValue', 1),
(1, 'PlcTest-H4-Dv2.ActualValue', 1),
(1, 'PlcTest-H4-Dv3.ActualValue', 0),
(0, 'PlcTest-H4-Dv4.ActualValue', 1))
)
for i in range(len(d)):
for j in range(len(d[i])):
if d[i][j][0] == 1:
a = pwrrt.attribute(d[i][j][1])
a.setValue(d[i][j][2])
time.sleep(0.1)
for i in range(len(d)):
for j in range(len(d[i])):
if d[i][j][0] == 0:
a = pwrrt.attribute(d[i][j][1])
val = a.value()
if val != d[i][j][2]:
self.logger.vlog('E', 'Plc thread %s, test value mismatch', str(i))
else:
self.logger.vlog('S', 'PlcThread %s test ok', str(i))
ctx = Ctx()
ctx.logger = pwrtest.logger('wbtest-rt', '$pwrp_log/pwrtest02_rt.tlog')
try:
ctx.init()
except:
quit()
pwrrt.login('pwrp', 'pwrp')
ctx.systemStatus()
ctx.plcThreads()
This diff is collapsed.
#include "pwr.h"
#include "co_cdh.h"
#include "rt_gdh.h"
#include "co_tst_log.h"
class wa_ldhtest {
pwr_tStatus m_sts;
ldh_tWorkbench m_ldhwb;
ldh_tSession m_ldhses;
ldh_tVolContext m_volctx;
pwr_tObjName m_vname;
pwr_tVid m_vid;
tst_log *m_log;
pwr_tOid m_test;
pwr_tOid m_test_h1;
pwr_tOid m_test_h2;
pwr_tOid m_root;
pwr_tStatus check_object(pwr_tOid oid);
public:
wa_ldhtest();
~wa_ldhtest();
void vname(char *n) {strncpy(m_vname, n, sizeof(m_vname));}
void Init();
void Close();
void ObjidToName();
void CreateObject();
void DeleteObject();
void DeleteObjectTree();
void ChangeObjectName();
void MoveObject();
void GetRootList();
void GetChild();
void GetParent();
void GetNextSibling();
void GetPreviousSibling();
void NameToAttrRef();
void AttrRefToName();
void AttrArefToObjectAref();
void GetClassList();
void GetNextObject();
void GetNextAttrRef();
void ClassNameToId();
void ClassIdToName();
void GetSuperClass();
void GetEnumValueDef();
void GetMaskBitDef();
void GetObjectClass();
void GetAttrRefTid();
void GetVolumeList();
void GetNextVolume();
void GetVolumeClass();
void GetVidInfo();
void GetVolumeInfo();
void AttachVolume();
void OpenWB();
void OpenSession();
void CopyObject();
void CopyObjectTrees();
void CreateVolume();
void GetObjectPar();
void SetObjectPar();
};
This diff is collapsed.
#!/bin/bash
exec()
{
echo "Executing $1"
$1
}
dexec()
{
echo "Executing $1"
$1 &
}
exec "wa_ldhtest volpwrtest02"
exec "wa_pwrwbtest.py"
#!/bin/bash
if [ "$1" == "" ]; then
start=1
else
start=$1
fi
if [ "$2" == "" ]; then
end=3
else
end=$2
fi
release="debian:10"
release_name="deb"
buildversion="08-SEP-2020 12:00:00"
build_rpi=1
gitrepo="-b stable http://192.168.0.104/git/x5-7-2/pwr/.git"
gitrepo="-b stable http://192.168.0.105/git/x5-7-2/pwr/.git"
install_update="apt-get update"
install_git="apt-get install -y git make"
install_build="apt-get install -y libgtk2.0-dev doxygen gcc g++ make libasound2-dev \
......@@ -27,7 +16,7 @@ install_pwr="apt-get install -y libgtk2.0-0 libasound2 \
libdb5.3 libdb5.3++ libsqlite3-0 librsvg2-2 g++ xterm libmariadb3 \
librabbitmq4 libusb-1.0-0 libhdf5-openmpi-103 librabbitmq4 \
libgstreamer1.0-0 libgstreamer-plugins-base1.0-0 openjdk-11-jdk \
xterm xfonts-100dpi sudo procps libpython-dev"
xterm xfonts-100dpi sudo procps libpython-dev python"
install_pwrrt="apt-get install -y libgtk2.0-0 libasound2 \
libdb5.3 libdb5.3++ libsqlite3-0 librsvg2-2 g++ xterm libmariadb3 \
librabbitmq4 libusb-1.0-0 libhdf5-openmpi-103 \
......@@ -42,11 +31,37 @@ pkg_pwrdemo="pwrdemo"$sver"_"$ver"_"$arch".deb"
pkg_pwrrt="pwrrt_"$ver"_"$arch".deb"
pkg_pwrsev="pwrsev_"$ver"_"$arch".deb"
pkg_pwrrpi="pwrrpi"$sver"_"$ver"_"$arch".deb"
img_pwrdev="pwrdev_"$release_name":v1"
img_pwrrt="pwrrt_"$release_name":v1"
if [ "$1" == "" ]; then
start=1
else
start=$1
fi
if [ "$2" == "" ]; then
end=7
else
end=$2
fi
if [ ! -e log ]; then
mkdir log
fi
if [ ! -e pkg ]; then
mkdir pkg
fi
if [ ! -e data ]; then
mkdir data
fi
# Build pwr container
if [ $start -le 1 ] && [ $end -ge 1 ]; then
docker image build -t pwr:v1 -f build/Dockerfile.build \
--build-arg RELEASE=$release \
--build-arg BUILDVERSION="$buildversion" \
--build-arg BUILD_RPI=$build_rpi \
--build-arg GITREPO="$gitrepo" \
--build-arg INSTALL_UPDATE="$install_update" \
......@@ -56,39 +71,57 @@ if [ $start -le 1 ] && [ $end -ge 1 ]; then
--build-arg JDK_DIR=$jdk_dir \
./
docker container create --name tmp pwr:v1
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/pkg/$pkg_pwr ./
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/pkg/$pkg_pwrdemo ./
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/pkg/$pkg_pwrrt ./
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/pkg/$pkg_pwrsev ./
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/pkg/$pkg_pwrrpi ./
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/project/pwrtest01/bld/common/load/pwrp_pkg_pwrtest01a_0001.tgz ./
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/project/pwrtest01/bld/common/load/pwrp_pkg_pwrtest01b_0001.tgz ./
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/project/pwrtest01/bld/common/load/pwrp_pkg_pwrtest01c_0001.tgz ./
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/project/pwrtest02/bld/common/load/pwrtest02.tar.gz ./
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/pkg/$pkg_pwr ./pkg/
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/pkg/$pkg_pwrdemo ./pkg/
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/pkg/$pkg_pwrrt ./pkg/
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/pkg/$pkg_pwrsev ./pkg/
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/pkg/$pkg_pwrrpi ./pkg/
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/project/pwrtest01/bld/common/load/pwrp_pkg_pwrtest01a_0001.tgz ./data/
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/project/pwrtest01/bld/common/load/pwrp_pkg_pwrtest01b_0001.tgz ./data/
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/project/pwrtest01/bld/common/load/pwrp_pkg_pwrtest01c_0001.tgz ./data/
docker container cp tmp:/pwr/rls/os_linux/hw_x86_64/bld/project/pwrtest02/bld/common/load/pwrtest02.tar.gz ./data/
docker container rm tmp
docker image rm pwr:v1
fi
# Demo container
# Pwrdev container
if [ $start -le 2 ] && [ $end -ge 2 ]; then
docker image build -t pwrdemo:v1 -f pwrdemo/Dockerfile.pwrdemo \
docker image build -t $img_pwrdev -f pwrdev/Dockerfile.pwrdev \
--build-arg RELEASE=$release \
--build-arg INSTALL_UPDATE="$install_update" \
--build-arg INSTALL_PWR="$install_pwr" \
--build-arg PKG_PWR=$pkg_pwr \
--build-arg PKG_PWRDEMO=$pkg_pwrdemo \
./
docker run --name pwrdm pwrdemo:v1
docker container cp pwrdm:/usr/pwrp/pwrdemo$sver/bld/common/tmp/pwrdemo_status.tlog ./log/
fi
# Runtime container pwrtest01c
# Pwrrt container
if [ $start -le 3 ] && [ $end -ge 3 ]; then
docker image build -t pwrtest01c:v1 -f pwrtest01c/Dockerfile.pwrtest01c \
docker image build -t $img_pwrrt -f pwrrt/Dockerfile.pwrrt \
--build-arg RELEASE=$release \
--build-arg INSTALL_UPDATE="$install_update" \
--build-arg INSTALL_PWRRT="$install_pwrrt" \
--build-arg PKG_PWRRT=$pkg_pwrrt \
./
fi
# Demo container
if [ $start -le 4 ] && [ $end -ge 4 ]; then
docker image build -t pwrdemo:v1 -f pwrdemo/Dockerfile.pwrdemo \
--build-arg RELEASE=$img_pwrdev \
--build-arg PKG_PWRDEMO=$pkg_pwrdemo \
./
docker run --name pwrdm pwrdemo:v1
docker container cp pwrdm:/usr/pwrp/pwrdemo$sver/bld/common/tmp/pwrdemo_status.tlog ./log/
docker container rm pwrdm
docker image rm pwrdemo:v1
fi
# Runtime container pwrtest01c
if [ $start -le 5 ] && [ $end -ge 5 ]; then
docker image build -t pwrtest01c:v1 -f pwrtest01/Dockerfile.pwrtest01c \
--build-arg RELEASE=$img_pwrrt \
./
docker run --name pwrtc pwrtest01c:v1
docker container cp pwrtc:/pwrp/common/log/plc.tlog ./log/
docker container cp pwrtc:/pwrp/common/log/aproc.tlog ./log/
......@@ -106,20 +139,48 @@ if [ $start -le 3 ] && [ $end -ge 3 ]; then
docker container cp pwrtc:/pwrp/common/log/ccm.tlog ./log/
docker container cp pwrtc:/pwrp/common/log/xttscript.tlog ./log/
docker container cp pwrtc:/pwrp/common/log/pwrrt.tlog ./log/
docker container rm pwrtc
docker image rm pwrtest01c:v1
fi
# Pwrtest02 container
if [ $start -le 4 ] && [ $end -ge 4 ]; then
if [ $start -le 6 ] && [ $end -ge 6 ]; then
docker image build -t pwrtest02:v1 -f pwrtest02/Dockerfile.pwrtest02 \
--build-arg RELEASE=$release \
--build-arg INSTALL_UPDATE="$install_update" \
--build-arg INSTALL_PWR="$install_pwr" \
--build-arg PKG_PWR=$pkg_pwr \
--build-arg RELEASE=$img_pwrdev \
./
docker run --name pwrt2 pwrtest02:v1
docker container cp pwrt2:/usr/pwrp/pwrtest02/bld/common/log/pwrtest02_classvolume.tlog ./log/
docker container cp pwrt2:/usr/pwrp/pwrtest02/bld/common/log/pwrtest02_rootvolume.tlog ./log/
docker container cp pwrt2:/usr/pwrp/pwrtest02/bld/common/log/ldh.tlog ./log/
docker container cp pwrt2:/usr/pwrp/pwrtest02/bld/common/log/pwrwb.tlog ./log/
docker container rm pwrt2
docker image rm pwrtest02:v1
fi
# Runtime container pwrtest01a and pwrtest01b
if [ $start -le 7 ] && [ $end -ge 7 ]; then
docker image build -t pwrtest01b:v1 -f pwrtest01/Dockerfile.pwrtest01b \
--build-arg RELEASE=$img_pwrrt \
./
docker image build -t pwrtest01a:v1 -f pwrtest01/Dockerfile.pwrtest01a \
--build-arg RELEASE=$img_pwrrt \
./
if ! docker network inspect pwrnet 1>/dev/null 2>/dev/null; then
docker network create --subnet=172.18.0.0/16 pwrnet
fi
docker run --name pwrtb --net pwrnet --ip 172.18.0.23 pwrtest01b:v1 &
pidb=$!
sleep 10
docker run --name pwrta --net pwrnet --ip 172.18.0.22 pwrtest01a:v1
wait $pidb
docker container cp pwrta:/pwrp/common/log/neth.tlog ./log/
docker container cp pwrta:/pwrp/common/log/qcom2a.tlog ./log/
docker container cp pwrtb:/pwrp/common/log/qcom2b.tlog ./log/
docker container rm pwrta pwrtb
docker image rm pwrtest01a:v1 pwrtest01b:v1
fi
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment