File tree 1 file changed +24
-3
lines changed
1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change 2
2
require 'pry'
3
3
4
4
build_path = File . expand_path File . join ( File . dirname ( __FILE__ ) , '..' )
5
- image_tag = 'test_klevo /percona'
5
+ image_tag = 'klevo /percona'
6
6
7
7
describe "image" do
8
8
before ( :all ) do
11
11
end
12
12
13
13
it "should expose the mysql tcp port" do
14
- # binding.pry
15
14
expect ( @image . json [ "Config" ] [ "ExposedPorts" ] ) . to include ( "3306/tcp" )
16
15
end
17
16
18
17
after ( :all ) do
19
- # @image.remove
18
+ end
19
+ end
20
+
21
+ describe "running container" do
22
+ before ( :all ) do
23
+ @image = Docker ::Image . build_from_dir build_path , t : image_tag
24
+ end
25
+
26
+ it "will start and run mysql daemon" do
27
+ @container = Docker ::Container . create (
28
+ 'Image' => image_tag ,
29
+ 'Detach' => true ,
30
+ 'Env' => [ 'MYSQL_ROOT_PASSWORD=something' ]
31
+ )
32
+ @container . start
33
+ root_my_cnf = @container . exec ( [ 'bash' , '-c' , 'cat /root/.my.cnf' ] )
34
+ expect ( root_my_cnf . first . first ) . to match ( /password=something/ )
35
+
36
+ # binding.pry
37
+ end
38
+
39
+ after ( :all ) do
40
+ @container . delete ( force : true )
20
41
end
21
42
end
You can’t perform that action at this time.
0 commit comments