Commit 2eff4111 authored by zauberstuhl's avatar zauberstuhl
Browse files

Update testproject dependencies

parent 6d508bba
Pipeline #866 passed with stages
in 14 minutes and 32 seconds
# vim:ft=sh
#
# this test file is related to https://feneas.git.feneas.org/federation/testsuite
load test_helper
@test "$btf create database" {
create_database tp1
[ "$?" -eq 0 ]
}
@test "$btf start testproject#1 server" {
start_app tp1 3000 testproject$(latest_tag testproject)
[ "$?" -eq 0 ]
# NOTE You can also wait for certain log output!
# Incase your server is only operational after
# a special message then you can use the wait_for
# function from the test_helper file:
#
# wait_for <command> <search-text>
#
# for this project that could look something like this:
#
# cmd="docker logs $(container_id tp1)"
# text="CREATE TABLE"
# code=$(wait_for "$cmd" "$text")
# [ "$code" -eq "0" ]
}
@test "$btf test initial count, it should be zero" {
get "http://$(container_ip tp1):3000"
echo "expected 200, got $HTTP_STATUS_CODE"
[ "$HTTP_STATUS_CODE" == "200" ]
echo "expected 0, got $HTTP_BODY"
[ "$HTTP_BODY" == "0" ]
}
@test "$btf increase count by one" {
get "http://$(container_ip tp1):3000/add"
[ "$HTTP_STATUS_CODE" == "200" ]
}
@test "$btf test count, it should be one" {
get "http://$(container_ip tp1):3000"
echo "expected 200, got $HTTP_STATUS_CODE"
[ "$HTTP_STATUS_CODE" == "200" ]
echo "expected 1, got $HTTP_BODY"
[ "$HTTP_BODY" == "1" ]
}
@test "$btf check the database for results too" {
result=$(query tp1 "select count(*) from testtable;")
echo "expected 1, got $result"
[[ $result =~ "1" ]]
}
@test "$btf stop and delete the container" {
stop_app tp1
[ "$?" -eq 0 ]
remove_app tp1
[ "$?" -eq 0 ]
}
@test "$btf drop database" {
drop_database tp1
[ "$?" -eq 0 ]
}
FROM debian:jessie
RUN apt-get update && apt-get install -y git-core
RUN apt-get update
RUN apt-get install -y git-core postgresql-client netcat
RUN git clone https://git.feneas.org/feneas/federation-testsuite-testproject.git
WORKDIR federation-testsuite-testproject
RUN git clone https://git.feneas.org/feneas/federation/testsuite-testproject.git
WORKDIR testsuite-testproject
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment