Skip to content
Snippets Groups Projects
Commit 6b17f459 authored by Fabrice Gangler's avatar Fabrice Gangler :art:
Browse files

test: modify tests to match Comptoir software behaviors

parent 9e07b2c2
No related branches found
No related tags found
No related merge requests found
Pipeline #76603 passed
require 'spec_helper_acceptance'
sys_rootpath = '/var/www/comptoir'
download_checksum_initial = 'f33363b96fc330b9298d3477f90ee1aaa09eb06605901b72af3d472c054cf223' # 3.0.0.alpha.4
##################################################################################################################
version_intitial = '3.0.0.alpha.4'
download_checksum_initial = 'f33363b96fc330b9298d3477f90ee1aaa09eb06605901b72af3d472c054cf223'
download_url_initial = 'https://gitlab.adullact.net/Comptoir/comptoir-du-libre/-/package_files/1056/download'
download_checksum_upgrade = '94b1030201af12ef2d3efbc263b21bc514c6c6fbb1043486cad00849538328fc' # 3.0.0.alpha.5
##################################################################################################################
version_upgrade = '3.0.0.alpha.5'
download_checksum_upgrade = '94b1030201af12ef2d3efbc263b21bc514c6c6fbb1043486cad00849538328fc'
download_url_upgrade = 'https://gitlab.adullact.net/Comptoir/comptoir-du-libre/-/package_files/1057/download'
##################################################################################################################
config_path = '/etc/comptoir'
archive_rootdir = 'comptoir'
var_path = '/var/comptoir'
......@@ -35,16 +40,22 @@ describe 'comptoir' do
it { is_expected.to be_linked_to "#{sys_rootpath}/#{download_checksum_initial}/#{archive_rootdir}" }
end
describe command('curl http://127.0.0.1') do
its(:stdout) { is_expected.to match %r{HOME PAGE} } # Fixme
describe command('curl -i http://127.0.0.1') do
its(:stdout) { is_expected.to match %r{HTTP/1.1 308 Permanent Redirect} }
its(:stdout) { is_expected.to match %r{Location: /fr/} }
its(:stdout) { is_expected.to match %r{x-comptoir-webapp: 1} }
end
# describe command('curl http://127.0.0.1') do
# its(:stdout) { is_expected.to match %r{v0.10.0} }
# end
describe command('curl -i http://127.0.0.1/fr/') do
its(:stdout) { is_expected.to match %r{HTTP/1.1 200 OK} }
its(:stdout) { is_expected.to match %r{x-comptoir-webapp: 1} }
its(:stdout) { is_expected.to match %r{<title>Comptoir-du-Libre} }
end
describe command('curl --head http://127.0.0.1/health-check') do
its(:stdout) { is_expected.to match %r{x-comptoir-name-fixme-database-status: DB_CONNECTION_SUCCESSFUL} } # Fixme
its(:stdout) { is_expected.to match %r{HTTP/1.1 200 OK} }
its(:stdout) { is_expected.to match %r{x-comptoir-database-status: DB_CONNECTION_SUCCESSFUL} }
its(:stdout) { is_expected.to match %r{x-comptoir-version: #{version_intitial}} }
end
describe file(config_path.to_s) do
......@@ -152,16 +163,22 @@ describe 'comptoir' do
apply_manifest(pp, catch_changes: true)
end
describe command('curl http://127.0.0.1') do
its(:stdout) { is_expected.to match %r{HOME PAGE} } # Fixme
describe command('curl -i http://127.0.0.1') do
its(:stdout) { is_expected.to match %r{HTTP/1.1 308 Permanent Redirect} }
its(:stdout) { is_expected.to match %r{Location: /fr/} }
its(:stdout) { is_expected.to match %r{x-comptoir-webapp: 1} }
end
# describe command('curl http://127.0.0.1') do
# its(:stdout) { is_expected.to match %r{v0.10.0} }
# end
describe command('curl -i http://127.0.0.1/fr/') do
its(:stdout) { is_expected.to match %r{HTTP/1.1 200 OK} }
its(:stdout) { is_expected.to match %r{x-comptoir-webapp: 1} }
its(:stdout) { is_expected.to match %r{<title>Comptoir-du-Libre} }
end
describe command('curl --head http://127.0.0.1/health-check') do
its(:stdout) { is_expected.to match %r{x-comptoir-name-fixme-database-status: DB_CONNECTION_SUCCESSFUL} } # Fixme
its(:stdout) { is_expected.to match %r{HTTP/1.1 200 OK} }
its(:stdout) { is_expected.to match %r{x-comptoir-database-status: DB_CONNECTION_SUCCESSFUL} }
its(:stdout) { is_expected.to match %r{x-comptoir-version: #{version_upgrade}} }
end
describe file("#{sys_rootpath}/#{download_checksum_initial}") do
......
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