0

I deploy Linux servers all the time and would like to test each installation. Like a system test.

For applications there a numerous of test frameworks, but I can't find anything for testing the a server installation.

To be more specific: Using Puppet I deploy various of Ubuntu combinations, such as LAMP, LNMP, Solr, Elasticsearch, Nodejs, etc. In a later stage someone else add an application to these installations. To ensure best quality as possible, I now run Jenkins with a matrix that test run each possible combination of Puppet manifests that I use. This ensures that Puppet won't fail during deployment.

The problem is that even if Puppet succeeds, there is no guarantee that, for example ElasicSearch actually works, or that iptables block the correct ports and so on. Of course I could write a bunch of bash scripts for testing, but that's just the wrong way.

The question is, does a framework for this already exists (but I've missed it)? Or are there any other good suggestion how to proceed here? The goal is to have the possibility to test for running processes, connect to ports, etc.

Thanks,

magnusa
  • 81
  • 6
  • `The problem is that even if Puppet succeeds, there is no guarantee that, for example ElasicSearch actually works, or that iptables block the correct ports and so on.` Then you haven't configured the system correctly. – user9517 Jun 03 '16 at 07:56
  • True, but that is the reason for tests. – magnusa Jun 03 '16 at 09:38

2 Answers2

1

I found the prefect match (for me atleast).

Now I use ServerSpec. You run it locally or remote on the test target machine and the test cases looks something like this:

describe port(80) do
  it { should be_listening }
end

There are tons of test resources described here. You can check for existing users, files, crontab entries, iptables rules and much more.

magnusa
  • 81
  • 6
  • You sound like you'd be much happier with `chef` than `puppet`. The `chef` folks test everything at every level. Puppet, not so much. – chicks Jul 21 '16 at 22:13
0

You're looking for something called monitoring. You just setup some tests and monitoring software will run it and report results. There is many of those software, in example zabbix or nagios.

Ondra Sniper Flidr
  • 2,653
  • 12
  • 18
  • Perhaps I didn't explain good enough. Jenkins spins up an empty machine, deploys it with Puppet and then the machines dies. Having something like Zabbix or Nagios would be very awkward, and would probably result in synchronization issues. Now, I just run ServerSpec as a Jenkins test stage before the server is killed. – magnusa Jul 21 '16 at 21:44