vagrant-subutai 7.0.2 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/CHANGELOG.md +7 -1
- data/LICENSE +201 -0
- data/lib/vagrant-subutai.rb +1 -0
- data/lib/vagrant-subutai/cleanup.rb +79 -0
- data/lib/vagrant-subutai/create_disk.rb +1 -0
- data/lib/vagrant-subutai/packer/script/remove_virtual_disk.ps1 +12 -0
- data/lib/vagrant-subutai/packer/subutai_config.rb +22 -4
- data/lib/vagrant-subutai/packer/subutai_disk.rb +44 -43
- data/lib/vagrant-subutai/packer/subutai_validation.rb +23 -8
- data/lib/vagrant-subutai/plugin.rb +5 -0
- data/lib/vagrant-subutai/version.rb +1 -1
- data/test/disk_create.yml +2 -0
- data/test/disk_size.yml +1 -0
- data/test/management_script.sh +0 -0
- data/test/management_test_file.deb +0 -0
- data/test/subutai-validation-0.yml +29 -0
- data/test/subutai1.yaml +1 -1
- data/test/subutai2.yaml +2 -2
- data/test/subutai_config_test.rb +121 -20
- data/test/subutai_disk_test.rb +220 -0
- data/test/subutai_net_test.rb +2 -1
- data/test/subutai_validation_test.rb +85 -0
- data/test/vagrant-subutai-disk-grow.yml +1 -0
- data/test/vagrant-subutai-disk-with-path.yml +2 -0
- data/test/vagrant-subutai-disk-withoutpath.yml +1 -0
- metadata +25 -2
data/test/subutai_net_test.rb
CHANGED
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require_relative '../lib/vagrant-subutai/packer/subutai_validation'
|
3
|
+
require_relative '../lib/vagrant-subutai/packer/subutai_config'
|
4
|
+
|
5
|
+
# Tests the subutai_hooks module
|
6
|
+
class SubutaiValidationTest < Test::Unit::TestCase
|
7
|
+
def setup
|
8
|
+
# Do nothing
|
9
|
+
end
|
10
|
+
|
11
|
+
def teardown
|
12
|
+
# Do nothing
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_bool
|
16
|
+
assert_true(SubutaiValidation.bool?('true'))
|
17
|
+
assert_false(SubutaiValidation.bool?('not_fool'))
|
18
|
+
assert_true(SubutaiValidation.bool?('false'))
|
19
|
+
assert_true(SubutaiValidation.bool?(true))
|
20
|
+
assert_true(SubutaiValidation.bool?(false))
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_is_json
|
24
|
+
assert_true(SubutaiValidation.is_json?("{\"key\": \"value\"}"))
|
25
|
+
assert_false(SubutaiValidation.is_json?("{key: value}"))
|
26
|
+
assert_false(SubutaiValidation.is_json?("key value"))
|
27
|
+
assert_true(SubutaiValidation.is_json?({"key": "value"}))
|
28
|
+
assert_true(SubutaiValidation.is_json?('{"key": "value"}'))
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_validation
|
32
|
+
assert_true(SubutaiValidation.validate(:AUTHORIZED_KEYS, './test/'))
|
33
|
+
assert_true(SubutaiValidation.validate(:DISK_SIZE, 1000))
|
34
|
+
assert_true(SubutaiValidation.validate(:LIBVIRT_NO_MACVTAP, 'false'))
|
35
|
+
assert_true(SubutaiValidation.validate(:SUBUTAI_ENV, 'sysnet'))
|
36
|
+
assert_true(SubutaiValidation.validate(:APT_PROXY_URL, 'https://google.com'))
|
37
|
+
assert_true(SubutaiValidation.validate(:SUBUTAI_SCOPE, 'PublIC'))
|
38
|
+
|
39
|
+
assert_raise do
|
40
|
+
SubutaiValidation.validate(:DISK_SIZE, 'fdfd')
|
41
|
+
end
|
42
|
+
|
43
|
+
assert_raise do
|
44
|
+
SubutaiValidation.validate(:SUBUTAI_ENV_TYPE, 'bazaaar')
|
45
|
+
end
|
46
|
+
|
47
|
+
assert_raise do
|
48
|
+
SubutaiValidation.validate(:SUBUTAI_SCOPE, 'private1')
|
49
|
+
end
|
50
|
+
|
51
|
+
assert_raise do
|
52
|
+
SubutaiValidation.validate(:SUBUTAI_SCOPE, 'private1')
|
53
|
+
end
|
54
|
+
|
55
|
+
assert_raise do
|
56
|
+
SubutaiValidation.validate(:SUBUTAI_MAN_TMPL, 'private1')
|
57
|
+
end
|
58
|
+
|
59
|
+
assert_raise do
|
60
|
+
SubutaiValidation.validate(:SUBUTAI_PASSWORD, 56565)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_user_conf_params
|
65
|
+
SubutaiValidation::USER_CONF_PARAMS_TYPE.keys.each do |key|
|
66
|
+
assert_true(SubutaiConfig::USER_PARAMETERS.include?(key))
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_user_conf_params_type
|
71
|
+
user_conf_types = [:int, :bool, :path, :url, :string, :enum, :json_object]
|
72
|
+
|
73
|
+
SubutaiValidation::USER_CONF_PARAMS_TYPE.keys.each do |key|
|
74
|
+
assert_true(user_conf_types.include?(SubutaiValidation::USER_CONF_PARAMS_TYPE[key]))
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_writable_and_exist
|
79
|
+
assert_false(SubutaiValidation.writable_and_exist?('/home'))
|
80
|
+
assert_true(SubutaiValidation.writable_and_exist?("#{Dir.pwd}"))
|
81
|
+
assert_false(SubutaiValidation.writable_and_exist?('/root'))
|
82
|
+
|
83
|
+
assert_false(SubutaiValidation.writable_and_exist?('/home/not_exist_user'))
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
DISK_SIZE: 500
|
@@ -0,0 +1 @@
|
|
1
|
+
DISK_SIZE: 150
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-subutai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Subutai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -48,6 +48,7 @@ files:
|
|
48
48
|
- CHANGELOG.md
|
49
49
|
- CODEOWNERS
|
50
50
|
- Gemfile
|
51
|
+
- LICENSE
|
51
52
|
- README.md
|
52
53
|
- Rakefile
|
53
54
|
- build.sh
|
@@ -55,6 +56,7 @@ files:
|
|
55
56
|
- lib/vagrant-subutai/blueprint/ansible_controller.rb
|
56
57
|
- lib/vagrant-subutai/blueprint/environment_controller.rb
|
57
58
|
- lib/vagrant-subutai/blueprint/variables_controller.rb
|
59
|
+
- lib/vagrant-subutai/cleanup.rb
|
58
60
|
- lib/vagrant-subutai/command.rb
|
59
61
|
- lib/vagrant-subutai/config.rb
|
60
62
|
- lib/vagrant-subutai/configs/configs.rb
|
@@ -67,6 +69,7 @@ files:
|
|
67
69
|
- lib/vagrant-subutai/models/environment.rb
|
68
70
|
- lib/vagrant-subutai/packer/script/create_disk_and_attach.ps1
|
69
71
|
- lib/vagrant-subutai/packer/script/create_virtual_switch.ps1
|
72
|
+
- lib/vagrant-subutai/packer/script/remove_virtual_disk.ps1
|
70
73
|
- lib/vagrant-subutai/packer/subutai_config.rb
|
71
74
|
- lib/vagrant-subutai/packer/subutai_disk.rb
|
72
75
|
- lib/vagrant-subutai/packer/subutai_hooks.rb
|
@@ -85,13 +88,23 @@ files:
|
|
85
88
|
- lib/vagrant_init.rb
|
86
89
|
- test/.rubocop.yml
|
87
90
|
- test/bad_snap_script.sh
|
91
|
+
- test/disk_create.yml
|
92
|
+
- test/disk_size.yml
|
93
|
+
- test/management_script.sh
|
94
|
+
- test/management_test_file.deb
|
88
95
|
- test/snap_script.sh
|
96
|
+
- test/subutai-validation-0.yml
|
89
97
|
- test/subutai0.yaml
|
90
98
|
- test/subutai1.yaml
|
91
99
|
- test/subutai2.yaml
|
92
100
|
- test/subutai_config_test.rb
|
101
|
+
- test/subutai_disk_test.rb
|
93
102
|
- test/subutai_hooks_test.rb
|
94
103
|
- test/subutai_net_test.rb
|
104
|
+
- test/subutai_validation_test.rb
|
105
|
+
- test/vagrant-subutai-disk-grow.yml
|
106
|
+
- test/vagrant-subutai-disk-with-path.yml
|
107
|
+
- test/vagrant-subutai-disk-withoutpath.yml
|
95
108
|
- vagrant-subutai.gemspec
|
96
109
|
- vagrant-subutai.iml
|
97
110
|
homepage: https://subutai.io
|
@@ -121,10 +134,20 @@ summary: '["Subutai CLI. Execute subutai commands outside the Vagrant box"]'
|
|
121
134
|
test_files:
|
122
135
|
- test/.rubocop.yml
|
123
136
|
- test/bad_snap_script.sh
|
137
|
+
- test/disk_create.yml
|
138
|
+
- test/disk_size.yml
|
139
|
+
- test/management_script.sh
|
140
|
+
- test/management_test_file.deb
|
124
141
|
- test/snap_script.sh
|
142
|
+
- test/subutai-validation-0.yml
|
125
143
|
- test/subutai0.yaml
|
126
144
|
- test/subutai1.yaml
|
127
145
|
- test/subutai2.yaml
|
128
146
|
- test/subutai_config_test.rb
|
147
|
+
- test/subutai_disk_test.rb
|
129
148
|
- test/subutai_hooks_test.rb
|
130
149
|
- test/subutai_net_test.rb
|
150
|
+
- test/subutai_validation_test.rb
|
151
|
+
- test/vagrant-subutai-disk-grow.yml
|
152
|
+
- test/vagrant-subutai-disk-with-path.yml
|
153
|
+
- test/vagrant-subutai-disk-withoutpath.yml
|