File tree 6 files changed +55
-3
lines changed
6 files changed +55
-3
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- # Managed by modulesync - DO NOT EDIT
3
- # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4
-
5
2
name : CI
6
3
7
4
on : pull_request
@@ -74,11 +71,16 @@ jobs:
74
71
with :
75
72
ruby-version : ' 3.0'
76
73
bundler-cache : true
74
+ - name : Start squid
75
+ run : ./scripts/start-squid.sh
77
76
- name : Run tests
78
77
run : bundle exec rake beaker
79
78
env :
80
79
BEAKER_PUPPET_COLLECTION : ${{ matrix.puppet.collection }}
81
80
BEAKER_setfile : ${{ matrix.setfile.value }}
81
+ - name : squid logs
82
+ run : docker logs squid --tail 50
83
+ if : always()
82
84
83
85
tests :
84
86
needs :
Original file line number Diff line number Diff line change @@ -3,3 +3,5 @@ spec/spec_helper.rb:
3
3
spec_overrides : " require 'spec_helper_methods'"
4
4
spec/spec_helper_acceptance.rb :
5
5
unmanaged : false
6
+ .github/workflows/ci.yml :
7
+ unmanaged : true
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ cat << EOF > /tmp/squid.conf
4
+ http_port 3128
5
+ http_access allow all
6
+ logfile_rotate 0
7
+ cache_log stdio:/dev/stdout
8
+ access_log stdio:/dev/stdout
9
+ cache_store_log stdio:/dev/stdout
10
+ EOF
11
+
12
+ docker run --detach --rm \
13
+ --name squid \
14
+ --hostname squid \
15
+ --publish 3128:3128 \
16
+ --env=' SQUID_CONFIG_FILE=/etc/squid/my-squid.conf' \
17
+ --volume=/tmp/squid.conf:/etc/squid/my-squid.conf:ro \
18
+ b4tman/squid
19
+
20
+ sleep 3
21
+ docker logs squid --tail 100
22
+
23
+ docker inspect -f ' {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' squid > ~ /SQUID_IP
Original file line number Diff line number Diff line change 54
54
end
55
55
end
56
56
# rubocop:enable RSpec/RepeatedExampleGroupBody,RSpec/RepeatedExampleGroupDescription
57
+
58
+ describe 'install with proxy' do
59
+ it 'installs idempotently with no errors' do
60
+ pp = "class{'prometheus::node_exporter': proxy_server => 'http://squid:3128', proxy_type => 'http'}"
61
+ # Run it twice and test for idempotency
62
+ apply_manifest ( pp , catch_failures : true )
63
+ apply_manifest ( pp , catch_changes : true )
64
+ end
65
+
66
+ describe service ( 'node_exporter' ) do
67
+ it { is_expected . to be_running }
68
+ it { is_expected . to be_enabled }
69
+ end
70
+
71
+ describe port ( 9100 ) do
72
+ it { is_expected . to be_listening . with ( 'tcp6' ) }
73
+ end
74
+ end
57
75
end
Original file line number Diff line number Diff line change 4
4
ensure => present ,
5
5
}
6
6
}
7
+
8
+ file_line { '/etc/hosts-squid' :
9
+ path => ' /etc/hosts' ,
10
+ line => " ${facts['squid_ip']} squid" ,
11
+ }
Original file line number Diff line number Diff line change 5
5
6
6
require 'voxpupuli/acceptance/spec_helper_acceptance'
7
7
8
+ ENV [ 'BEAKER_FACTER_SQUID_IP' ] = File . read ( File . expand_path ( '~/SQUID_IP' ) ) . chomp
9
+
8
10
configure_beaker
9
11
10
12
Dir [ './spec/support/acceptance/**/*.rb' ] . sort . each { |f | require f }
You can’t perform that action at this time.
0 commit comments