Skip to content

Commit

Permalink
Write tests (#6)
Browse files Browse the repository at this point in the history
* Try verifying the csrmake script

* Add missing required package
  • Loading branch information
dale-c-anderson authored Jul 7, 2021
1 parent f5debd7 commit 9b676bc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 8 deletions.
14 changes: 6 additions & 8 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@
changed_when: false
when: ansible_os_family == 'Debian'

- name: Install rsync on instance
- name: Install required packages
package:
name: rsync
state: latest

- name: Install make
package:
name: make
state: latest
name:
- rsync
- make
- openssl
state: present

roles:
- role: ansible-role-csrmake
37 changes: 37 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
- name: Verify
hosts: all
become: true
tasks:

- name: Run the csrmake script
shell: |
echo 'devnull@localhost
foo.example.com
CA
Some-state
SomeCity
Internet Widgits Pty Ltd
OrgUnitName
foo.example.com
[email protected]
CompanyName
' | /usr/local/ssl/csrmake_sha256.sh
args:
executable: /bin/bash

- name: Collect the contents of private dir
find:
paths: /usr/local/ssl/private/
patterns: '*.key.*'
file_type: file
register: find_result

- assert:
that:
- find_result.matched == 1
fail_msg: "No 'key' files were found"
success_msg: "Private key file was generated"

0 comments on commit 9b676bc

Please sign in to comment.