Test: Added expect to Dockerfile and made sure pagination test worked in docker
This commit is contained in:
parent
e0f5472161
commit
159ac0a2d7
6 changed files with 14 additions and 9 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -13,8 +13,6 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: install expect
|
|
||||||
run: sudo apt install -y expect
|
|
||||||
# 1) checkout and compile natively
|
# 1) checkout and compile natively
|
||||||
- name: install cligen
|
- name: install cligen
|
||||||
run: (git clone https://github.com/clicon/cligen.git && cd cligen && ./configure && make && sudo make install)
|
run: (git clone https://github.com/clicon/cligen.git && cd cligen && ./configure && make && sudo make install)
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ RUN install example.xml /clixon/build/etc/clixon.xml
|
||||||
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
|
||||||
|
RUN install *.exp /clixon/build/bin/test
|
||||||
|
|
||||||
# Copy startscript
|
# Copy startscript
|
||||||
WORKDIR /clixon
|
WORKDIR /clixon
|
||||||
|
|
@ -101,7 +102,7 @@ MAINTAINER Olof Hagsand <olof@hagsand.se>
|
||||||
RUN apk add --update flex bison fcgi-dev
|
RUN apk add --update flex bison fcgi-dev
|
||||||
|
|
||||||
# Test-specific (for test scripts)
|
# Test-specific (for test scripts)
|
||||||
RUN apk add --update sudo curl procps grep make bash # iproute2 # contains ip
|
RUN apk add --update sudo curl procps grep make bash expect
|
||||||
|
|
||||||
# Create clicon user and group
|
# Create clicon user and group
|
||||||
RUN adduser -D -H clicon
|
RUN adduser -D -H clicon
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@ RUN install example.xml /clixon/build/etc/clixon.xml
|
||||||
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
|
||||||
|
RUN install *.exp /clixon/build/bin/test
|
||||||
|
|
||||||
# Copy startscript
|
# Copy startscript
|
||||||
WORKDIR /clixon
|
WORKDIR /clixon
|
||||||
|
|
@ -117,7 +118,7 @@ RUN adduser -D -H -G www-data www-data
|
||||||
RUN apk add --update nginx
|
RUN apk add --update nginx
|
||||||
|
|
||||||
# Test-specific (for test scripts)
|
# Test-specific (for test scripts)
|
||||||
RUN apk add --update sudo curl procps grep make bash # iproute2 # contains ip
|
RUN apk add --update sudo curl procps grep make bash expect
|
||||||
|
|
||||||
# Expose nginx port for restconf
|
# Expose nginx port for restconf
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ RUN install example.xml /clixon/build/etc/clixon.xml
|
||||||
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
|
||||||
|
RUN install *.exp /clixon/build/bin/test
|
||||||
|
|
||||||
# Copy startscript
|
# Copy startscript
|
||||||
WORKDIR /clixon
|
WORKDIR /clixon
|
||||||
|
|
@ -132,7 +133,7 @@ RUN apk add --update openssl
|
||||||
RUN apk add --update nghttp2
|
RUN apk add --update nghttp2
|
||||||
|
|
||||||
# Test-specific (for test scripts)
|
# Test-specific (for test scripts)
|
||||||
RUN apk add --update sudo curl procps grep make bash # iproute2 # contains ip - but CAP_SYS_ADMIN isssue
|
RUN apk add --update sudo curl procps grep make bash expect
|
||||||
|
|
||||||
# Expose https port for restconf
|
# Expose https port for restconf
|
||||||
EXPOSE 80/tcp
|
EXPOSE 80/tcp
|
||||||
|
|
|
||||||
|
|
@ -152,9 +152,10 @@ wait_backend
|
||||||
|
|
||||||
xpath="/es:members/es:member[es:member-id=\'bob\']/es:favorites/es:uint64-numbers"
|
xpath="/es:members/es:member[es:member-id=\'bob\']/es:favorites/es:uint64-numbers"
|
||||||
new "cli show pagination config using expect"
|
new "cli show pagination config using expect"
|
||||||
expect ./test_pagination_expect.exp "$cfg" "$xpath" "uint64-numbers 18" "uint64-numbers 19"
|
expect ./test_pagination_expect.exp "$cfg" "$xpath" "uint64-numbers 18" "uint64-numbers 19"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
#$clixon_cli -f $cfg -l o -1 show pagination xpath /es:members/es:member[es:member-id=\'bob\']/es:favorites/es:uint64-numbers cli
|
err1 "Failed: CLI show paginate config scroll using expect"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $BE -ne 0 ]; then
|
if [ $BE -ne 0 ]; then
|
||||||
new "Kill backend"
|
new "Kill backend"
|
||||||
|
|
|
||||||
|
|
@ -163,8 +163,11 @@ if [ -n "$(type expect 2> /dev/null)" ]; then
|
||||||
|
|
||||||
testrun_start "/es:audit-logs/es:audit-log"
|
testrun_start "/es:audit-logs/es:audit-log"
|
||||||
|
|
||||||
newtest "CLI scroll test using expect"
|
new "CLI scroll test using expect"
|
||||||
expect ./test_pagination_expect.exp "$cfg" "$xpath" bob3 bob4
|
expect ./test_pagination_expect.exp "$cfg" "$xpath" bob3 bob4
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
err1 "Failed: CLI show paginate state scroll using expect"
|
||||||
|
fi
|
||||||
|
|
||||||
testrun_stop
|
testrun_stop
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue