github actions: try docker test
This commit is contained in:
parent
8bd0aa82d6
commit
6bac41890d
3 changed files with 10 additions and 44 deletions
38
.github/workflows/ci.yml
vendored
38
.github/workflows/ci.yml
vendored
|
|
@ -13,41 +13,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: install cligen
|
|
||||||
run: (git clone https://github.com/clicon/cligen.git && cd cligen && ./configure && make && sudo make install)
|
|
||||||
- name: install libevent
|
|
||||||
run: sudo apt install -y libevent-dev libssl-dev
|
|
||||||
- name: install libevhtp
|
|
||||||
run: (git clone https://github.com/clicon/clixon-libevhtp.git && cd clixon-libevhtp && ./configure && make && sudo make install)
|
|
||||||
- name: clixon and www-data users
|
|
||||||
run: sudo useradd -M -U clicon && sudo usermod -a -G clicon www-data
|
|
||||||
- name: prepare clixon tests
|
|
||||||
run: sudo apt install -y libcurl4-openssl-dev
|
|
||||||
- name: configure
|
- name: configure
|
||||||
run: ./configure --with-restconf=native
|
run: ./configure --with-restconf=native
|
||||||
- name: make
|
- name: make test # this is docker test
|
||||||
run: make
|
run: make test
|
||||||
- name: make install
|
|
||||||
run: sudo make install
|
|
||||||
- name: make install-include
|
|
||||||
run: sudo make install-include
|
|
||||||
- name: make example
|
|
||||||
run: (cd example; make)
|
|
||||||
- name: install example
|
|
||||||
run: (cd example; sudo make install)
|
|
||||||
- name: make util
|
|
||||||
run: (cd util; make)
|
|
||||||
- name: install util
|
|
||||||
run: (cd util; sudo make install)
|
|
||||||
- name: ldconfig
|
|
||||||
run: sudo ldconfig
|
|
||||||
- name: prepare test1
|
|
||||||
run: echo "#!/usr/bin/env bash" > test/site.sh
|
|
||||||
- name: prepare test2
|
|
||||||
run: echo "IPv6=true" >> test/site.sh
|
|
||||||
- name: prepare test3
|
|
||||||
run: echo "SKIPLIST=\"test_api.sh test_client.sh test_c++.sh test_install.sh test_privileges.sh\"" >> test/site.sh
|
|
||||||
- name: test
|
|
||||||
run: (cd test; ./all.sh)
|
|
||||||
# - name: make test # this is docker test
|
|
||||||
# run: make test
|
|
||||||
14
test/lib.sh
14
test/lib.sh
|
|
@ -337,12 +337,12 @@ function wait_backend(){
|
||||||
reply=$(echo "<rpc $DEFAULTNS><ping $LIBNS/></rpc>]]>]]>" | $clixon_netconf -qef $cfg 2> /dev/null)
|
reply=$(echo "<rpc $DEFAULTNS><ping $LIBNS/></rpc>]]>]]>" | $clixon_netconf -qef $cfg 2> /dev/null)
|
||||||
let i=0;
|
let i=0;
|
||||||
while [[ $reply != "<rpc-reply"* ]]; do
|
while [[ $reply != "<rpc-reply"* ]]; do
|
||||||
echo "sleep $DEMSLEEP"
|
# echo "sleep $DEMSLEEP"
|
||||||
sleep $DEMSLEEP
|
sleep $DEMSLEEP
|
||||||
reply=$(echo "<rpc $ÐEFAULTSNS $LIBNS><ping/></rpc>]]>]]>" | clixon_netconf -qef $cfg 2> /dev/null)
|
reply=$(echo "<rpc $ÐEFAULTSNS $LIBNS><ping/></rpc>]]>]]>" | clixon_netconf -qef $cfg 2> /dev/null)
|
||||||
echo "reply:$reply"
|
# echo "reply:$reply"
|
||||||
let i++;
|
let i++;
|
||||||
echo "wait_backend $i"
|
# echo "wait_backend $i"
|
||||||
if [ $i -ge $DEMLOOP ]; then
|
if [ $i -ge $DEMLOOP ]; then
|
||||||
err "backend timeout $DEMWAIT seconds"
|
err "backend timeout $DEMWAIT seconds"
|
||||||
fi
|
fi
|
||||||
|
|
@ -382,18 +382,18 @@ function stop_restconf(){
|
||||||
# Reasons for not working: if you run native is nginx running?
|
# Reasons for not working: if you run native is nginx running?
|
||||||
# @note assumes port=80 if RCPROTO=http and port=443 if RCPROTO=https
|
# @note assumes port=80 if RCPROTO=http and port=443 if RCPROTO=https
|
||||||
function wait_restconf(){
|
function wait_restconf(){
|
||||||
echo "curl $CURLOPTS $* $RCPROTO://localhost/restconf"
|
# echo "curl $CURLOPTS $* $RCPROTO://localhost/restconf"
|
||||||
hdr=$(curl $CURLOPTS $* $RCPROTO://localhost/restconf 2> /dev/null)
|
hdr=$(curl $CURLOPTS $* $RCPROTO://localhost/restconf 2> /dev/null)
|
||||||
echo "hdr:\"$hdr\""
|
# echo "hdr:\"$hdr\""
|
||||||
let i=0;
|
let i=0;
|
||||||
while [[ $hdr != *"200"* ]]; do
|
while [[ $hdr != *"200"* ]]; do
|
||||||
echo "wait_restconf $i"
|
# echo "wait_restconf $i"
|
||||||
if [ $i -ge $DEMLOOP ]; then
|
if [ $i -ge $DEMLOOP ]; then
|
||||||
err1 "restconf timeout $DEMWAIT seconds"
|
err1 "restconf timeout $DEMWAIT seconds"
|
||||||
fi
|
fi
|
||||||
sleep $DEMSLEEP
|
sleep $DEMSLEEP
|
||||||
hdr=$(curl $CURLOPTS $* $RCPROTO://localhost/restconf 2> /dev/null)
|
hdr=$(curl $CURLOPTS $* $RCPROTO://localhost/restconf 2> /dev/null)
|
||||||
echo "hdr:\"$hdr\""
|
# echo "hdr:\"$hdr\""
|
||||||
let i++;
|
let i++;
|
||||||
done
|
done
|
||||||
if [ $valgrindtest -eq 3 ]; then
|
if [ $valgrindtest -eq 3 ]; then
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ if [ $BE -ne 0 ]; then
|
||||||
err
|
err
|
||||||
fi
|
fi
|
||||||
new "start backend -s init -f $cfg"
|
new "start backend -s init -f $cfg"
|
||||||
start_backend -s init -f $cfg -D 1 -l e
|
start_backend -s init -f $cfg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
new "wait backend"
|
new "wait backend"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue