Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion manifests/cvemap_downloader.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
String $timer_interval = '24h',
) {
include iop::core_gateway
include iop::service_vmaas
Copy link
Member

Choose a reason for hiding this comment

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

circular dependencies and shit

Copy link
Member

Choose a reason for hiding this comment

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

why does it need core gateway?


$script_path = '/usr/local/bin/iop-cvemap-download.sh'
$basedir = '/var/www/html/pub'
Expand Down
5 changes: 4 additions & 1 deletion manifests/service_vmaas.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@
include iop::core_kafka
include iop::core_gateway
include iop::database
include iop::cvemap_downloader
include certs::iop

class { 'iop::cvemap_downloader':
ensure => $ensure,
}

$service_name = 'iop-service-vmaas-reposcan'
$client_ca_cert_secret_name = "${service_name}-client-ca-cert"
$database_username_secret_name = "${service_name}-database-username"
Expand Down
41 changes: 41 additions & 0 deletions spec/acceptance/service_vmaas_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ class { 'iop::service_vmaas': }
describe command("podman run --rm --network=iop-core-network quay.io/iop/vmaas curl -s -o /dev/null -w '%{http_code}' http://iop-service-vmaas-reposcan:8000/healthz") do
its(:stdout) { should match /200/ }
end

describe service('iop-cvemap-download.timer') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end

describe service('iop-cvemap-download.path') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end

describe file('/usr/local/bin/iop-cvemap-download.sh') do
it { is_expected.to be_file }
it { is_expected.to be_executable }
end
end

context 'with ensure => absent' do
Expand Down Expand Up @@ -74,5 +89,31 @@ class { 'iop::service_vmaas':
its(:exit_status) { should eq 1 }
its(:stdout) { should be_empty }
end

describe service('iop-cvemap-download.timer') do
it { is_expected.not_to be_running }
it { is_expected.not_to be_enabled }
end

describe service('iop-cvemap-download.path') do
it { is_expected.not_to be_running }
it { is_expected.not_to be_enabled }
end

describe file('/usr/local/bin/iop-cvemap-download.sh') do
it { is_expected.not_to exist }
end

describe file('/etc/systemd/system/iop-cvemap-download.service') do
it { is_expected.not_to exist }
end

describe file('/etc/systemd/system/iop-cvemap-download.timer') do
it { is_expected.not_to exist }
end

describe file('/etc/systemd/system/iop-cvemap-download.path') do
it { is_expected.not_to exist }
end
end
end