Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update omnibus ctl test command for Inspec 3.0 #1772

Merged
merged 1 commit into from
Oct 23, 2018

Conversation

robbkidd
Copy link
Contributor

--format was deprecated in 2.0 and removed in 3.0

Reorder the command built so that the switches come at the end. Use Inspec's reporter ability to write to an output file instead of doing the write ourselves in the ctl command.

vagrant@default-ubuntu-1604:~$ sudo supermarket-ctl test -J pedant.xml

vagrant@default-ubuntu-1604:~$ echo $?
0
vagrant@default-ubuntu-1604:~$ cat pedant.xml
<?xml version='1.0'?>
<testsuites>
  <testsuite name='omnibus-supermarket-test' tests='27' failed='0' failures='0'>
    <testcase name='Command: `supermarket-ctl console` stderr should match /supermarket-ctl console should be run as the supermarket OS user./' classname='omnibus-supermarket-test.supermarket-ctl-perms' target='local://' time='0.083338514'/>
    <testcase name='Command: `supermarket-ctl make-admin` stderr should match /supermarket-ctl make-admin should be run as the supermarket OS user./' classname='omnibus-supermarket-test.supermarket-ctl-perms' target='local://' time='0.087811592'/>
    <testcase name='Command: `sudo -u supermarket supermarket-ctl make-admin user=nope` stdout should match /nope was not found in Supermarket./' classname='omnibus-supermarket-test.supermarket-ctl-perms' target='local://' time='3.112217706'/>
    <testcase name='File /var/opt/supermarket/ssl/ca/dhparams.pem should be file' classname='omnibus-supermarket-test.ssl-config' target='local://' time='0.002105947'/>
    <testcase name='File /var/opt/supermarket/ssl/ca/dhparams.pem content should match /BEGIN DH PARAMETERS/' classname='omnibus-supermarket-test.ssl-config' target='local://' time='0.000237771'/>
    <testcase name='File /var/opt/supermarket/nginx/etc/sites-enabled/rails content should match /ssl_dhparam/' classname='omnibus-supermarket-test.ssl-config' target='local://' time='0.000123776'/>
    <testcase name='File /var/opt/supermarket/etc/logrotate.d should be directory' classname='omnibus-supermarket-test.log-management' target='local://' time='0.00010437'/>
    <testcase name='File /var/opt/supermarket/etc/logrotate.conf should be file' classname='omnibus-supermarket-test.log-management' target='local://' time='9.5736e-05'/>
    <testcase name='File /var/opt/supermarket/etc/logrotate.conf content should match /include \/var\/opt\/supermarket\/etc\/logrotate.d/' classname='omnibus-supermarket-test.log-management' target='local://' time='0.000331378'/>
    <testcase name='File /etc/cron.hourly/supermarket_logrotate should be file' classname='omnibus-supermarket-test.log-management' target='local://' time='0.000105546'/>
    <testcase name='File /etc/cron.hourly/supermarket_logrotate content should match /logrotate \/var\/opt\/supermarket\/etc\/logrotate.conf/' classname='omnibus-supermarket-test.log-management' target='local://' time='0.000149632'/>
    <testcase name='File /var/opt/supermarket/etc/logrotate.d/nginx should be file' classname='omnibus-supermarket-test.log-management' target='local://' time='8.7805e-05'/>
    <testcase name='File /var/opt/supermarket/etc/logrotate.d/nginx content should match /\/var\/log\/supermarket\/nginx\/\*.log/' classname='omnibus-supermarket-test.log-management' target='local://' time='0.000119932'/>
    <testcase name='Port 80 should be listening' classname='omnibus-supermarket-test.proxy' target='local://' time='0.044886769'/>
    <testcase name='Port 80 protocols should include &quot;tcp&quot;' classname='omnibus-supermarket-test.proxy' target='local://' time='0.002450746'/>
    <testcase name='http GET to Port 80 should not include server version number in response headers' classname='omnibus-supermarket-test.proxy' target='local://' time='0.004516449'/>
    <testcase name='Port 443 should be listening' classname='omnibus-supermarket-test.proxy' target='local://' time='0.00049774'/>
    <testcase name='Port 443 protocols should include &quot;tcp&quot;' classname='omnibus-supermarket-test.proxy' target='local://' time='0.000150465'/>
    <testcase name='http GET to Port 443 should not include server version number in response headers' classname='omnibus-supermarket-test.proxy' target='local://' time='0.001211491'/>
    <testcase name='Port 15432 should be listening' classname='omnibus-supermarket-test.database' target='local://' time='0.000366446'/>
    <testcase name='Port 15432 protocols should include &quot;tcp&quot;' classname='omnibus-supermarket-test.database' target='local://' time='0.000112651'/>
    <testcase name='File /var/opt/supermarket/cache should be directory' classname='omnibus-supermarket-test.cache-dirs' target='local://' time='0.000195745'/>
    <testcase name='File /opt/supermarket/embedded/cookbooks/local-mode-cache should not exist' classname='omnibus-supermarket-test.cache-dirs' target='local://' time='0.000975247'/>
    <testcase name='Port 16379 should be listening' classname='omnibus-supermarket-test.redis' target='local://' time='0.00031308'/>
    <testcase name='Port 16379 protocols should include &quot;tcp&quot;' classname='omnibus-supermarket-test.redis' target='local://' time='0.000116171'/>
    <testcase name='Port 13000 should be listening' classname='omnibus-supermarket-test.web-app' target='local://' time='0.000265973'/>
    <testcase name='Port 13000 protocols should include &quot;tcp&quot;' classname='omnibus-supermarket-test.web-app' target='local://' time='0.000134956'/>
  </testsuite>
</testsuites>

--format was deprecated in 2.0 and removed in 3.0

Reorder the command built so that the switches come at the end. Use
Inspec's reporter ability to write to an output file instead of doing
the write ourselves in the ctl command.

Signed-off-by: Robb Kidd <[email protected]>
@robbkidd robbkidd requested a review from a team October 23, 2018 19:42
Copy link
Contributor

@schisamo schisamo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tenor-136319278
GOLD STAR FOR YOU!

@robbkidd robbkidd merged commit da87813 into master Oct 23, 2018
@robbkidd robbkidd deleted the robb/update-omnibus-test-for-inspec3 branch October 23, 2018 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants