From e16e742559d8e1d711ac7cc7197f489cc4f1c6bb Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Wed, 12 Jun 2019 16:28:06 +0200 Subject: [PATCH] test(packages): we have 4 groups of packages * test/integration/default/controls/pkgs_spec.rb: the packages of each group must be installed. --- .../integration/default/controls/pkgs_spec.rb | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/integration/default/controls/pkgs_spec.rb diff --git a/test/integration/default/controls/pkgs_spec.rb b/test/integration/default/controls/pkgs_spec.rb new file mode 100644 index 0000000..1f43032 --- /dev/null +++ b/test/integration/default/controls/pkgs_spec.rb @@ -0,0 +1,25 @@ +# coding: utf-8 +# +# pkgs_spec.rb -- Libvirt packages InSpec control +# Author: Daniel Dehennin +# Copyright © 2019 Pôle de Compétences Logiciels Libres +# +packages = { + 'libvirt' => ['libvirt'], + 'qemu' => ['qemu-kvm'], + 'extra' => ['libguestfs'], + 'python' => ['libvirt-python'], +} + +control 'Libvirt packages' do + title 'verify installed packages' + + packages.each do | service, pkgs | + pkgs.each do | pkg | + describe package(pkg) do + it { should be_installed } + end + end + end + +end