diff --git a/docker/test/Dockerfile b/docker/test/Dockerfile index 3afa9cbf..1eaa5e1c 100644 --- a/docker/test/Dockerfile +++ b/docker/test/Dockerfile @@ -42,6 +42,9 @@ RUN apk add --update git make build-base gcc flex bison curl-dev # For netsnmp RUN apk add --update net-snmp net-snmp-dev +# For groupadd/groupdel +RUN apk add --update shadow + # Checkout standard YANG models for tests (note >1G for full repo) RUN mkdir -p /usr/local/share/yang WORKDIR /usr/local/share/yang @@ -61,17 +64,17 @@ RUN git clone https://github.com/clicon/cligen.git # Build cligen WORKDIR /clixon/cligen -RUN ./configure --prefix=/usr/local +RUN ./configure --prefix=/usr/local --sysconfdir=/etc RUN make RUN make DESTDIR=/clixon/build install # Copy Clixon from local dir -RUN mkdir /clixon/clixon +RUN mkdir -p /clixon/clixon WORKDIR /clixon/clixon COPY clixon . # Configure, build and install clixon -RUN ./configure --prefix=/usr/local --with-cligen=/clixon/build --without-restconf --with-yang-standard-dir=/usr/local/share/yang/standard --enable-netsnmp --with-mib-generated-yang-dir=/usr/local/share/mib-yangs/ +RUN ./configure --prefix=/usr/local --sysconfdir=/etc --with-cligen=/clixon/build --with-yang-standard-dir=/usr/local/share/yang/standard --enable-netsnmp --with-mib-generated-yang-dir=/usr/local/share/mib-yangs/ -without-restconf RUN make RUN make DESTDIR=/clixon/build install @@ -80,6 +83,13 @@ WORKDIR /clixon/clixon/util RUN make RUN make DESTDIR=/clixon/build install +# Build and install the clixon example +WORKDIR /clixon/clixon/example/main +RUN make +RUN make DESTDIR=/clixon/build install +RUN mkdir -p /clixon/build/etc +RUN install example.xml /clixon/build/etc/clixon.xml + # Copy tests WORKDIR /clixon/clixon/test RUN install -d /clixon/build/usr/local/bin/test @@ -87,6 +97,9 @@ RUN install *.sh /clixon/build/usr/local/bin/test RUN install *.exp /clixon/build/usr/local/bin/test RUN install clixon.png /clixon/build/usr/local/bin/test +RUN install -d /clixon/build/mibs +RUN install mibs/* /clixon/build/mibs + # Copy startscript WORKDIR /clixon COPY startsystem.sh startsystem.sh diff --git a/docker/test/Dockerfile.fcgi b/docker/test/Dockerfile.fcgi index bc084a7d..56b25a58 100644 --- a/docker/test/Dockerfile.fcgi +++ b/docker/test/Dockerfile.fcgi @@ -31,12 +31,16 @@ # # ***** END LICENSE BLOCK ***** # +# Clixon dockerfile with fcgi restconf FROM alpine MAINTAINER Olof Hagsand # For clixon and cligen -RUN apk add --update git make build-base gcc flex bison fcgi-dev curl-dev +RUN apk add --update git make build-base gcc flex bison curl-dev + +# For fcgi +RUN apk add --update fcgi-dev # For netsnmp RUN apk add --update net-snmp net-snmp-dev @@ -78,7 +82,7 @@ RUN adduser -D -H -G www-data www-data RUN apk add --update nginx # Configure, build and install clixon -RUN ./configure --prefix=/usr/local --sysconfdir=/etc --with-cligen=/clixon/build --with-restconf=fcgi --with-yang-standard-dir=/usr/local/share/yang/standard --enable-netsnmp --with-mib-generated-yang-dir=/usr/local/share/mib-yangs/ +RUN ./configure --prefix=/usr/local --sysconfdir=/etc --with-cligen=/clixon/build --with-yang-standard-dir=/usr/local/share/yang/standard --enable-netsnmp --with-mib-generated-yang-dir=/usr/local/share/mib-yangs/ --with-restconf=fcgi RUN make RUN make DESTDIR=/clixon/build install diff --git a/test/test_privileges.sh b/test/test_privileges.sh index cda81c8b..43f42c00 100755 --- a/test/test_privileges.sh +++ b/test/test_privileges.sh @@ -21,14 +21,14 @@ cfg=$dir/conf_startup.xml fyang=$dir/clixon-example.yang # Here $dir is created by the user that runs the script - +# Cant be anything in root since it breaks some privileges cat < $cfg $cfg ${YANG_INSTALLDIR} $fyang - /var/run/$APPNAME.sock - /var/run/$APPNAME.pidfile + $dir/$APPNAME.sock + $dir/$APPNAME.pidfile $dir EOF @@ -87,7 +87,7 @@ function testrun(){ if [ $expecterr -eq 1 ]; then return 0 fi - err + err 1 $expecterr fi new "Number of clixon_backend processes"