Skip to content

Commit 7c0d183

Browse files
author
sdelano
committed
Merge branch 'CHEF-1864' into pl-master
2 parents a84ae3b + 2471de7 commit 7c0d183

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

‎features/steps/packages.rb‎

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,20 @@ def remove_integration_test_apt_source
2727

2828
After("@apt")do
2929
remove_integration_test_apt_source
30+
purge_chef_integration_debs
31+
shell_out!"apt-get clean"
32+
end
33+
34+
Before('@dpkg')do
35+
purge_chef_integration_debs
3036
end
3137

32-
Before('@dpkg,@apt')do
38+
Before('@apt')do
3339
purge_chef_integration_debs
40+
shell_out!"apt-get clean"
3441
end
3542

36-
After('@dpkg,@apt')do
43+
After('@dpkg')do
3744
purge_chef_integration_debs
3845
end
3946

@@ -64,6 +71,13 @@ def remove_integration_test_apt_source
6471

6572
apt_server.start
6673
end
74+
75+
Chef::Log.debug"Waiting for apt server to start"
76+
untiltcp_test_port("localhost",9000)do
77+
Chef::Log.debug"."
78+
sleep1
79+
end
80+
Chef::Log.debug"done"
6781
end
6882

6983
Given"I have updated my apt cache"do
@@ -119,3 +133,13 @@ def dpkg_should_be_installed(pkg_name)
119133
dpkg_should_be_installed(package_name)
120134
end
121135

136+
deftcp_test_port(hostname,port)
137+
tcp_socket=TCPSocket.new(hostname,port)
138+
true
139+
rescueErrno::ETIMEDOUT
140+
false
141+
rescueErrno::ECONNREFUSED
142+
false
143+
ensure
144+
tcp_socket && tcp_socket.close
145+
end

0 commit comments

Comments
(0)