Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ansible_lza_validators
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
ansible_lza_validators
Commits
c8e9342a
Commit
c8e9342a
authored
1 year ago
by
Jörg Sachse
Browse files
Options
Downloads
Patches
Plain Diff
test: add tests to verify CGI binaries work as expected (with more to implement)
parent
91056754
Loading
Loading
No related merge requests found
Pipeline
#5303
failed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
molecule/resources/playbooks/verify.yml
+27
-4
27 additions, 4 deletions
molecule/resources/playbooks/verify.yml
with
28 additions
and
5 deletions
.gitlab-ci.yml
+
1
−
1
View file @
c8e9342a
...
@@ -36,4 +36,4 @@ test-job:
...
@@ -36,4 +36,4 @@ test-job:
-
molecule create --scenario-name default
-
molecule create --scenario-name default
-
molecule converge --scenario-name default
-
molecule converge --scenario-name default
-
molecule idempotence --scenario-name default
-
molecule idempotence --scenario-name default
#
- molecule verify --scenario-name default
-
molecule verify --scenario-name default
This diff is collapsed.
Click to expand it.
molecule/resources/playbooks/verify.yml
+
27
−
4
View file @
c8e9342a
---
---
# This is an example playbook to execute Ansible tests.
-
name
:
Verify
-
name
:
Verify
hosts
:
all
hosts
:
all
gather_facts
:
false
gather_facts
:
false
tasks
:
tasks
:
-
name
:
Example assertion
-
name
:
get result for CGI-Binaries
ansible.builtin.command
:
cmd
:
"
/usr/lib/cgi-bin/{{
item
}}"
loop
:
-
"
convert_to"
-
"
is_valid"
register
:
cgi_binaries
changed_when
:
false
# The return code is 1 when calling the CGI-Binaries on the commandline,
# because the environment is not right and we're not PUTting a PDF file, so
# we expect failure. That's OK, we just want to see if it crashes or
# returns a nice HTML structure.
# This test does NOT tell us anything about the use of the correct
# libcgicc version. To do this, we would need to upload a file to tcp/8080
# and observe apache2/error.log output. If you feel up to the task of
# writing an appropriate test, please feel free to do so.
# If you try, expect the following apache error messages:
# [Thu Oct 19 13:28:12.252241 2023] [cgid:error] [pid 34681:tid 140007369025216] [client 10.0.2.2:56994] End of script output before headers: is_valid, referer: http://localhost:8080/cgi-bin/is_valid/pdfa
# terminate called after throwing an instance of 'PTB::exc'
# what(): The PDF file is corrupt, it could not be opened
failed_when
:
false
-
name
:
evaluate return code and message for CGI-Binaries
ansible.builtin.assert
:
ansible.builtin.assert
:
that
:
true
that
:
-
( 'Content-Type
:
text/html' in item.stdout )
-
( '<html><head' in item.stdout )
quiet
:
true
loop
:
"
{{
cgi_binaries.results
}}"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment