Test: fixed snmp for docker/fcgi

This commit is contained in:
Olof hagsand 2022-07-27 18:28:24 +02:00
parent b0d38a513c
commit bb069aa7b8
4 changed files with 19 additions and 6 deletions

View file

@ -41,9 +41,12 @@ RUN apk add --update git make build-base gcc flex bison fcgi-dev curl-dev
# For netsnmp # For netsnmp
RUN apk add --update net-snmp net-snmp-dev RUN apk add --update net-snmp net-snmp-dev
# Checkut standard YANG models for tests (note >1G for full repo) # Checkut models
WORKDIR /usr/local/share WORKDIR /usr/local/share/
# Checkout standard YANG models for tests (note >1G for full repo)
RUN mkdir yang RUN mkdir yang
WORKDIR /usr/local/share/yang WORKDIR /usr/local/share/yang
RUN git config --global init.defaultBranch master RUN git config --global init.defaultBranch master
@ -55,6 +58,12 @@ RUN echo "experimental/" >> .git/info/sparse-checkout
RUN git pull origin main RUN git pull origin main
RUN mkdir /usr/local/share/openconfig
WORKDIR /usr/local/share/openconfig
# Checkut Openconfig models for tests
RUN git clone https://github.com/openconfig/public
# Create a directory to hold source-code, dependencies etc # Create a directory to hold source-code, dependencies etc
RUN mkdir /clixon RUN mkdir /clixon
RUN mkdir /clixon/build RUN mkdir /clixon/build
@ -102,6 +111,9 @@ RUN install *.sh /clixon/build/bin/test
RUN install *.exp /clixon/build/bin/test RUN install *.exp /clixon/build/bin/test
RUN install clixon.png /clixon/build/bin/test RUN install clixon.png /clixon/build/bin/test
RUN install -d /clixon/build/mibs
RUN install mibs/* /clixon/build/mibs
# Copy startscript # Copy startscript
WORKDIR /clixon WORKDIR /clixon
COPY startsystem_fcgi.sh startsystem.sh COPY startsystem_fcgi.sh startsystem.sh
@ -148,6 +160,7 @@ RUN adduser www-data clicon
COPY --from=0 /clixon/build/ /usr/local/ COPY --from=0 /clixon/build/ /usr/local/
COPY --from=0 /usr/local/share/yang/* /usr/local/share/yang/standard/ COPY --from=0 /usr/local/share/yang/* /usr/local/share/yang/standard/
COPY --from=0 /usr/local/share/mib-yangs/* /usr/local/share/mib-yangs/ COPY --from=0 /usr/local/share/mib-yangs/* /usr/local/share/mib-yangs/
COPY --from=0 /clixon/build/mibs/* /usr/share/snmp/mibs/
# Manually created # Manually created
RUN mkdir /www-data RUN mkdir /www-data

View file

@ -69,7 +69,6 @@ RUN git clone https://github.com/openconfig/public
# Create a directory to hold source-code, dependencies etc # Create a directory to hold source-code, dependencies etc
RUN mkdir /clixon RUN mkdir /clixon
RUN mkdir /clixon/build RUN mkdir /clixon/build
WORKDIR /clixon WORKDIR /clixon
@ -107,7 +106,7 @@ RUN make
RUN make install RUN make install
RUN install example.xml /clixon/build/etc/clixon.xml RUN install example.xml /clixon/build/etc/clixon.xml
# Copy tests (why not everything?) # Copy tests
WORKDIR /clixon/clixon/test WORKDIR /clixon/clixon/test
RUN install -d /clixon/build/bin/test RUN install -d /clixon/build/bin/test
RUN install *.sh /clixon/build/bin/test RUN install *.sh /clixon/build/bin/test

View file

@ -44,7 +44,8 @@ set -ux # e but clixon_backend may fail if test is run in parallell
>&2 echo "$0" >&2 echo "$0"
DBG=${DBG:-0} # If set, enable debugging (of backend and restconf daemons)
: ${DBG:=0}
# Initiate clixon configuration (env variable) # Initiate clixon configuration (env variable)
echo "$CONFIG" > /usr/local/etc/clixon.xml echo "$CONFIG" > /usr/local/etc/clixon.xml

View file

@ -308,7 +308,7 @@ $sshcmd sudo ./yangmodels.sh
# Run tests # Run tests
$sshcmd "(cd src/cligen/test; ./sum.sh)" $sshcmd "(cd src/cligen/test; ./sum.sh)"
$sshcmd "(cd src/clixon/test; ./sum.sh)" $sshcmd "(cd src/clixon/test; detail=true ./sum.sh)"
# destroy vm # destroy vm
#if $destroy; then #if $destroy; then