Skip to content
Snippets Groups Projects
Commit e01924f8 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

test to check if database can be deployed without superuser privileges

parent db564d21
No related branches found
No related tags found
3 merge requests!46912.1.0~beta.4 into master,!45912.1.0~beta.3 into master,!454Resolve "fix migration script to work on database without superadmin privileges"
Pipeline #6775 failed
......@@ -5,6 +5,12 @@ stages:
- packaging
- test
variables:
POSTGRES_DB: map_viewer
POSTGRES_USER: map_viewer
POSTGRES_PASSWORD: "123qweasdzxc"
test_frontend:
stage: test
script:
......@@ -116,3 +122,30 @@ rpmlint:
- yum -y install rpmlint
- rpmlint rpm/rpmbuildtemp/RPMS/noarch/minerva-*.rpm
test_deploy_with_db_without_superadmin_rights:
image: tomcat:7-jre8
stage: test
services:
- postgres:9.6
dependencies:
- build_war
tags:
- privileged
only:
- tags
script:
- apt-get update
- apt-get install -y postgresql-client
- mkdir /etc/minerva
- echo "database.uri=jdbc:postgresql://postgres:5432/test" > /etc/minerva/db.properties
- echo "database.username=test" >> /etc/minerva/db.properties
- echo "database.password=test" >> /etc/minerva/db.properties
- echo "CREATE DATABASE test;CREATE USER test WITH ENCRYPTED PASSWORD 'test';GRANT ALL PRIVILEGES ON DATABASE test TO test;" >tmp.sql
- PGPASSWORD=$POSTGRES_PASSWORD psql -h postgres -U $POSTGRES_USER $POSTGRES_DB < tmp.sql
- wget https://git-r3lab.uni.lu/minerva/core/-/jobs/32480/artifacts/raw/minerva.war -O /usr/local/tomcat/webapps/minerva.war
- /usr/local/tomcat/bin/startup.sh
- sleep 15
#test if we can login and list projects
- test 200 = $(curl --write-out %{http_code} --silent --output /dev/null -c cookie.txt http://localhost:8080/minerva/api/doLogin)
- test 200 = $(curl --write-out %{http_code} --silent --output /dev/null --cookie cookie.txt http://localhost:8080/minerva/api/projects/)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment