Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Add test cases

Add test cases #823

Workflow file for this run

name: C/C++ CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libconfig-dev libsystemd-dev libjansson-dev libcurl4-gnutls-dev libldap2-dev libmicrohttpd-dev libsqlite3-dev sqlite3 libpq-dev liboath-dev default-libmysqlclient-dev cmake pkg-config check libsubunit-dev cppcheck gnutls-bin libcbor-dev git
- name: cppcheck
run: cppcheck --force --enable=warning,missingInclude --error-exitcode=1 src/ docs/resources/ulfius/
- name: dependencies
run: |
cd /opt
git clone https://github.com/babelouest/orcania.git
git clone https://github.com/babelouest/yder.git
git clone https://github.com/babelouest/hoel.git
git clone https://github.com/babelouest/ulfius.git
git clone https://github.com/babelouest/rhonabwy.git
git clone https://github.com/babelouest/iddawc.git
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ../orcania
make
sudo make install
rm -rf *
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ../yder
make
sudo make install
rm -rf *
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ../hoel
make
sudo make install
rm -rf *
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ../ulfius
make
sudo make install
rm -rf *
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ../rhonabwy
make
sudo make install
rm -rf *
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ../iddawc
make
sudo make install
rm -rf *
- name: build
run: |
mkdir build
cd build
cmake -DBUILD_GLEWLWYD_TESTING=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ..
make
sudo make install
- name: build-webapp
run: |
cd webapp-src
npm install
make build-webapp
- name: test
run: |
sqlite3 /tmp/glewlwyd.db < docs/database/init.sqlite3.sql
sqlite3 /tmp/glewlwyd.db < test/glewlwyd-test.sql
cd build
glewlwyd --config-file=../test/glewlwyd-travis.conf &
export G_PID=$!
../test/cert/create-cert.sh || (cat ../test/cert/certtool.log && false)
ln -s ../test/cert/ .
ln -s ../test/ .
make test || (cat Testing/Temporary/LastTest.log && cat /tmp/glewlwyd.log && false)
kill $G_PID
glewlwyd --config-file=cert/glewlwyd-cert-ci.conf &
make glewlwyd_scheme_certificate glewlwyd_oidc_client_certificate
sleep 1
export G_PID=$!
(./glewlwyd_scheme_certificate && ./glewlwyd_oidc_client_certificate) || (cat /tmp/glewlwyd-https.log && false)
kill $G_PID
glewlwyd --config-file=test/glewlwyd-profile-delete-disable.conf &
sleep 1
export G_PID=$!
./glewlwyd_profile_delete disable || (cat /tmp/glewlwyd-disable.log && false)
kill $G_PID
glewlwyd --config-file=test/glewlwyd-profile-delete-yes.conf &
sleep 1
export G_PID=$!
./glewlwyd_profile_delete delete || (cat /tmp/glewlwyd-delete.log && false)
kill $G_PID
make glewlwyd_prometheus
glewlwyd --config-file=test/glewlwyd-prometheus.conf &
sleep 1
export G_PID=$!
./glewlwyd_prometheus || (cat /tmp/glewlwyd-prometheus.log && false)
kill $G_PID
make glewlwyd_auth_single_user_session
glewlwyd --config-file=test/glewlwyd-single-user-session.conf &
sleep 1
export G_PID=$!
./glewlwyd_auth_single_user_session || (cat /tmp/glewlwyd-single-user-session.log && false)
kill $G_PID