foreman_bootdisk 15.0.0 → 17.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop.yaml +19 -0
- data/.tx/config +1 -1
- data/AUTHORS +11 -0
- data/README.md +25 -0
- data/app/controllers/concerns/allowed_actions.rb +16 -0
- data/app/controllers/foreman_bootdisk/api/v2/disks_controller.rb +9 -7
- data/app/controllers/foreman_bootdisk/api/v2/subnet_disks_controller.rb +16 -4
- data/app/controllers/foreman_bootdisk/disks_controller.rb +14 -10
- data/app/helpers/concerns/foreman_bootdisk/hosts_helper_ext.rb +71 -45
- data/app/lib/foreman_bootdisk/scope/bootdisk.rb +28 -1
- data/app/lib/foreman_bootdisk/scope/full_host_bootdisk_efi.rb +15 -0
- data/app/models/concerns/foreman_bootdisk/compute_resources/vmware.rb +10 -1
- data/app/models/concerns/foreman_bootdisk/host_ext.rb +13 -6
- data/app/models/concerns/foreman_bootdisk/orchestration/compute.rb +38 -22
- data/app/models/setting/bootdisk.rb +25 -19
- data/app/services/foreman_bootdisk/iso_generator.rb +132 -51
- data/app/services/foreman_bootdisk/renderer.rb +36 -19
- data/app/views/foreman_bootdisk/generic_efi_host.erb +68 -0
- data/app/views/foreman_bootdisk/generic_static_host.erb +34 -0
- data/app/views/foreman_bootdisk/host.erb +29 -8
- data/db/seeds.d/50-bootdisk_templates.rb +15 -31
- data/lib/foreman_bootdisk/engine.rb +9 -6
- data/lib/foreman_bootdisk/version.rb +1 -1
- data/lib/tasks/bootdisk.rake +10 -24
- data/locale/action_names.rb +7 -0
- data/locale/ca/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/ca/foreman_bootdisk.po +58 -7
- data/locale/de/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/de/foreman_bootdisk.po +62 -11
- data/locale/en/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/en/foreman_bootdisk.po +56 -5
- data/locale/en_GB/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/en_GB/foreman_bootdisk.po +62 -11
- data/locale/es/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/es/foreman_bootdisk.po +62 -11
- data/locale/foreman_bootdisk.pot +108 -36
- data/locale/fr/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/fr/foreman_bootdisk.po +61 -10
- data/locale/it/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/it/foreman_bootdisk.po +60 -9
- data/locale/ja/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/ja/foreman_bootdisk.po +61 -10
- data/locale/ko/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/ko/foreman_bootdisk.po +60 -9
- data/locale/pt_BR/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/pt_BR/foreman_bootdisk.po +60 -9
- data/locale/ru/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/ru/foreman_bootdisk.po +60 -9
- data/locale/sv_SE/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/sv_SE/foreman_bootdisk.po +59 -8
- data/locale/zh_CN/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/zh_CN/foreman_bootdisk.po +60 -9
- data/locale/zh_TW/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/zh_TW/foreman_bootdisk.po +60 -9
- data/release-gem +2 -0
- data/test/functional/foreman_bootdisk/api/v2/disks_controller_test.rb +51 -17
- data/test/functional/foreman_bootdisk/api/v2/subnet_disks_controller_test.rb +23 -10
- data/test/functional/foreman_bootdisk/disks_controller_test.rb +65 -25
- data/test/test_plugin_helper.rb +21 -3
- data/test/unit/concerns/host_test.rb +12 -1
- data/test/unit/concerns/orchestration/compute_test.rb +32 -13
- data/test/unit/foreman_bootdisk/renderer_test.rb +1 -1
- data/test/unit/iso_generator_test.rb +6 -7
- metadata +14 -9
Binary file
|
@@ -5,10 +5,10 @@
|
|
5
5
|
# Translators:
|
6
6
|
msgid ""
|
7
7
|
msgstr ""
|
8
|
-
"Project-Id-Version: foreman_bootdisk
|
8
|
+
"Project-Id-Version: foreman_bootdisk 17.0.0\n"
|
9
9
|
"Report-Msgid-Bugs-To: \n"
|
10
|
-
"PO-Revision-Date: 2019-
|
11
|
-
"Last-Translator:
|
10
|
+
"PO-Revision-Date: 2019-10-22 20:06+0000\n"
|
11
|
+
"Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>\n"
|
12
12
|
"Language-Team: Chinese (China) (http://www.transifex.com/foreman/foreman/langu"
|
13
13
|
"age/zh_CN/)\n"
|
14
14
|
"MIME-Version: 1.0\n"
|
@@ -20,6 +20,9 @@ msgstr ""
|
|
20
20
|
msgid "A variant of the per-host image which contains the OS bootloader embedded inside the disk. This may be useful if chainloading fails on certain hardware, but has the downside that the image must be regenerated for any change in the OS, bootloader or PXELinux templates."
|
21
21
|
msgstr "每个包含磁盘内置 OS 引导装载程序的主机映像变体。如果某个硬件中的链载入失败,这个变体可能会有帮助,但缺点是必须为所有 OS、引导装载程序或 PXELinux 模板中的所有更改重新生成该映像。"
|
22
22
|
|
23
|
+
msgid "Action with sub plans"
|
24
|
+
msgstr "带有子计划的操作"
|
25
|
+
|
23
26
|
msgid "All images are usable as either ISOs or as disk images, including being written to a USB disk with `dd`."
|
24
27
|
msgstr "所有映像都可作为 ISO 或者磁盘映像使用,包括使用 `dd` 写入的 USB盘。"
|
25
28
|
|
@@ -44,9 +47,18 @@ msgstr "引导磁盘内嵌的模板"
|
|
44
47
|
msgid "Boot disks"
|
45
48
|
msgstr "引导磁盘"
|
46
49
|
|
50
|
+
msgid "Both IP and Subnet must be set"
|
51
|
+
msgstr ""
|
52
|
+
|
47
53
|
msgid "Command to generate ISO image, use genisoimage or mkisofs"
|
48
54
|
msgstr "使用 genisoimage 或者 mkisofs 命令生成 ISO 映像。"
|
49
55
|
|
56
|
+
msgid "Creating new image failed, install truncate utility"
|
57
|
+
msgstr ""
|
58
|
+
|
59
|
+
msgid "Detach ISO image from CDROM drive for %s"
|
60
|
+
msgstr ""
|
61
|
+
|
50
62
|
msgid "Download generic image"
|
51
63
|
msgstr "下载通用映像"
|
52
64
|
|
@@ -56,9 +68,21 @@ msgstr "下载主机映像"
|
|
56
68
|
msgid "Download subnet generic image"
|
57
69
|
msgstr "下载子网通用映象"
|
58
70
|
|
71
|
+
msgid "Ensure %{path} contains grubx64.efi and shimx64.efi: install TFTP module or copy those files into /var/lib/foreman/bootdisk (Grub2 directory setting)"
|
72
|
+
msgstr ""
|
73
|
+
|
59
74
|
msgid "Failed to attach ISO image to CDROM drive of instance %{name}: %{message}"
|
60
75
|
msgstr "未能成功将 ISO 映像附加到实例 %{name} 的 CDROM 驱动:%{message}"
|
61
76
|
|
77
|
+
msgid "Failed to create a directory within the ESP image"
|
78
|
+
msgstr ""
|
79
|
+
|
80
|
+
msgid "Failed to detach ISO image from CDROM drive of instance %{name}: %{message}"
|
81
|
+
msgstr ""
|
82
|
+
|
83
|
+
msgid "Failed to format the ESP image via mkfs.msdos"
|
84
|
+
msgstr ""
|
85
|
+
|
62
86
|
msgid "Failed to generate ISO image for instance %{name}: %{message}"
|
63
87
|
msgstr "为实例 %{name} 生成 ISO 映像失败:%{message}"
|
64
88
|
|
@@ -77,6 +101,9 @@ msgstr "完整主机映像"
|
|
77
101
|
msgid "Generating ISO image for %s"
|
78
102
|
msgstr "为 %s 生成 ISO 映像"
|
79
103
|
|
104
|
+
msgid "Generic Grub2 EFI image template"
|
105
|
+
msgstr ""
|
106
|
+
|
80
107
|
msgid "Generic image"
|
81
108
|
msgstr "原始映像"
|
82
109
|
|
@@ -86,14 +113,23 @@ msgstr "原始映像模板"
|
|
86
113
|
msgid "Generic images are a reusable disk image that works for any host registered in Foreman. It requires a basic DHCP and DNS service to function and contact the server, but does not require DHCP reservations or static IP addresses."
|
87
114
|
msgstr "通用映像是可重复使用的映像,可用于 Foreman 中注册的所有主机。它要求使用 DHCP 和 DNS 服务与服务器联络,但不要求 DHCP 预订或静态 IP 地址。"
|
88
115
|
|
116
|
+
msgid "Grub2 directory"
|
117
|
+
msgstr ""
|
118
|
+
|
119
|
+
msgid "Grub2 template to use for generic EFI host boot disks"
|
120
|
+
msgstr ""
|
121
|
+
|
89
122
|
msgid "Help"
|
90
123
|
msgstr "帮助"
|
91
124
|
|
92
125
|
msgid "Host '%s' image"
|
93
126
|
msgstr "主机 '%s' 映像"
|
94
127
|
|
95
|
-
msgid "Host
|
96
|
-
msgstr "
|
128
|
+
msgid "Host bootdisk does not work with static IPv6"
|
129
|
+
msgstr ""
|
130
|
+
|
131
|
+
msgid "Host has no IPv4 or IPv6 address defined"
|
132
|
+
msgstr ""
|
97
133
|
|
98
134
|
msgid "Host has no domain defined"
|
99
135
|
msgstr "没有为主机定义域"
|
@@ -119,12 +155,18 @@ msgstr "ISO 构建失败"
|
|
119
155
|
msgid "ISO generation command"
|
120
156
|
msgstr "ISO 生成命令"
|
121
157
|
|
122
|
-
msgid "ISO hybrid conversion failed"
|
123
|
-
msgstr "
|
158
|
+
msgid "ISO hybrid conversion failed: %s"
|
159
|
+
msgstr ""
|
124
160
|
|
125
161
|
msgid "ISOLINUX directory"
|
126
162
|
msgstr "ISOLINUX 目录"
|
127
163
|
|
164
|
+
msgid "Import Puppet classes"
|
165
|
+
msgstr "导入 Puppet 类"
|
166
|
+
|
167
|
+
msgid "Import facts"
|
168
|
+
msgstr "导入 fact"
|
169
|
+
|
128
170
|
msgid "Installation media caching"
|
129
171
|
msgstr "安装介质缓存"
|
130
172
|
|
@@ -134,6 +176,9 @@ msgstr "可为完整主机映像缓存安装介质文件"
|
|
134
176
|
msgid "Once chainloaded, the OS bootloader and installer are downloaded directly from the installation media configured in Foreman, and the provisioning script (kickstart/preseed) is downloaded from Foreman."
|
135
177
|
msgstr "链载入后,即可从 Foreman 中配置的安装介质直接下载 OS 引导装载程序和安装程序,并可从 Foreman 中下载供应脚本(kickstart/preseed)。"
|
136
178
|
|
179
|
+
msgid "Path to directory containing grubx64.efi and shimx64.efi"
|
180
|
+
msgstr ""
|
181
|
+
|
137
182
|
msgid "Path to directory containing iPXE images"
|
138
183
|
msgstr "包含 iPXE 映像目录的路径"
|
139
184
|
|
@@ -155,6 +200,9 @@ msgstr "请确保已安装 isolinux/syslinux 软件包。"
|
|
155
200
|
msgid "Plugin for Foreman that creates iPXE-based boot disks to provision hosts without the need for PXE infrastructure."
|
156
201
|
msgstr "为 Foreman 生成基于 iPXE 的引导磁盘的插件,在不需要 PXE 架构的条件下即可供应主机。"
|
157
202
|
|
203
|
+
msgid "Remote action:"
|
204
|
+
msgstr "远程操作:"
|
205
|
+
|
158
206
|
msgid "SYSLINUX directory"
|
159
207
|
msgstr "SYSLINUX 目录"
|
160
208
|
|
@@ -188,10 +236,13 @@ msgstr "True 代表完整映像,false 代表基本可重复使用映像。"
|
|
188
236
|
msgid "Unable to find template specified by %s setting"
|
189
237
|
msgstr "无法找到 %s 设置指定的模板"
|
190
238
|
|
191
|
-
msgid "Unable to generate disk
|
239
|
+
msgid "Unable to generate disk %{kind} template: %{error}"
|
240
|
+
msgstr ""
|
241
|
+
|
242
|
+
msgid "Unable to generate disk template, %{kind} template not found."
|
192
243
|
msgstr ""
|
193
244
|
|
194
|
-
msgid "Unable to
|
245
|
+
msgid "Unable to mcopy %{path}"
|
195
246
|
msgstr ""
|
196
247
|
|
197
248
|
msgid "Upload ISO image to datastore for %s"
|
Binary file
|
@@ -5,10 +5,10 @@
|
|
5
5
|
# Translators:
|
6
6
|
msgid ""
|
7
7
|
msgstr ""
|
8
|
-
"Project-Id-Version: foreman_bootdisk
|
8
|
+
"Project-Id-Version: foreman_bootdisk 17.0.0\n"
|
9
9
|
"Report-Msgid-Bugs-To: \n"
|
10
|
-
"PO-Revision-Date: 2019-
|
11
|
-
"Last-Translator:
|
10
|
+
"PO-Revision-Date: 2019-10-22 20:06+0000\n"
|
11
|
+
"Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>\n"
|
12
12
|
"Language-Team: Chinese (Taiwan) (http://www.transifex.com/foreman/foreman/lang"
|
13
13
|
"uage/zh_TW/)\n"
|
14
14
|
"MIME-Version: 1.0\n"
|
@@ -20,6 +20,9 @@ msgstr ""
|
|
20
20
|
msgid "A variant of the per-host image which contains the OS bootloader embedded inside the disk. This may be useful if chainloading fails on certain hardware, but has the downside that the image must be regenerated for any change in the OS, bootloader or PXELinux templates."
|
21
21
|
msgstr "個別主機映像檔的變體,磁碟中嵌入了 OS 的開機載入程式。這對於在特定硬體上的 chainloading 失敗時特別有幫助,不過缺點就是若要對 OS、開機載入程式或 PXELinux 範本進行任何更改,映像檔就必須重新產生。"
|
22
22
|
|
23
|
+
msgid "Action with sub plans"
|
24
|
+
msgstr "有子計畫的動作"
|
25
|
+
|
23
26
|
msgid "All images are usable as either ISOs or as disk images, including being written to a USB disk with `dd`."
|
24
27
|
msgstr "所有映像檔皆能作為 ISO 或是磁碟映像檔使用,包括以 `dd` 寫入一個 USB 磁碟中。"
|
25
28
|
|
@@ -44,9 +47,18 @@ msgstr ""
|
|
44
47
|
msgid "Boot disks"
|
45
48
|
msgstr "開機磁碟"
|
46
49
|
|
50
|
+
msgid "Both IP and Subnet must be set"
|
51
|
+
msgstr ""
|
52
|
+
|
47
53
|
msgid "Command to generate ISO image, use genisoimage or mkisofs"
|
48
54
|
msgstr "請使用 genisoimage 或是 mkisofs 來作為產生 ISO 映像檔的指令"
|
49
55
|
|
56
|
+
msgid "Creating new image failed, install truncate utility"
|
57
|
+
msgstr ""
|
58
|
+
|
59
|
+
msgid "Detach ISO image from CDROM drive for %s"
|
60
|
+
msgstr ""
|
61
|
+
|
50
62
|
msgid "Download generic image"
|
51
63
|
msgstr "下載泛型映像檔"
|
52
64
|
|
@@ -56,9 +68,21 @@ msgstr "下載主機映像檔"
|
|
56
68
|
msgid "Download subnet generic image"
|
57
69
|
msgstr "下載子網路泛型映像檔"
|
58
70
|
|
71
|
+
msgid "Ensure %{path} contains grubx64.efi and shimx64.efi: install TFTP module or copy those files into /var/lib/foreman/bootdisk (Grub2 directory setting)"
|
72
|
+
msgstr ""
|
73
|
+
|
59
74
|
msgid "Failed to attach ISO image to CDROM drive of instance %{name}: %{message}"
|
60
75
|
msgstr ""
|
61
76
|
|
77
|
+
msgid "Failed to create a directory within the ESP image"
|
78
|
+
msgstr ""
|
79
|
+
|
80
|
+
msgid "Failed to detach ISO image from CDROM drive of instance %{name}: %{message}"
|
81
|
+
msgstr ""
|
82
|
+
|
83
|
+
msgid "Failed to format the ESP image via mkfs.msdos"
|
84
|
+
msgstr ""
|
85
|
+
|
62
86
|
msgid "Failed to generate ISO image for instance %{name}: %{message}"
|
63
87
|
msgstr ""
|
64
88
|
|
@@ -77,6 +101,9 @@ msgstr "完整的主機映像檔"
|
|
77
101
|
msgid "Generating ISO image for %s"
|
78
102
|
msgstr ""
|
79
103
|
|
104
|
+
msgid "Generic Grub2 EFI image template"
|
105
|
+
msgstr ""
|
106
|
+
|
80
107
|
msgid "Generic image"
|
81
108
|
msgstr "泛型映像檔"
|
82
109
|
|
@@ -86,14 +113,23 @@ msgstr ""
|
|
86
113
|
msgid "Generic images are a reusable disk image that works for any host registered in Foreman. It requires a basic DHCP and DNS service to function and contact the server, but does not require DHCP reservations or static IP addresses."
|
87
114
|
msgstr "泛型映像檔是個可重複使用的磁碟映像檔,並且可使用於任何向 Foreman 註冊過的主機上。它需要一項基本的 DHCP 和 DNS 服務才能運作和聯絡伺服器,不過並不需要 DHCP 預留或靜態 IP 位址。"
|
88
115
|
|
116
|
+
msgid "Grub2 directory"
|
117
|
+
msgstr ""
|
118
|
+
|
119
|
+
msgid "Grub2 template to use for generic EFI host boot disks"
|
120
|
+
msgstr ""
|
121
|
+
|
89
122
|
msgid "Help"
|
90
123
|
msgstr "協助"
|
91
124
|
|
92
125
|
msgid "Host '%s' image"
|
93
126
|
msgstr "主機「%s」映像檔"
|
94
127
|
|
95
|
-
msgid "Host
|
96
|
-
msgstr "
|
128
|
+
msgid "Host bootdisk does not work with static IPv6"
|
129
|
+
msgstr ""
|
130
|
+
|
131
|
+
msgid "Host has no IPv4 or IPv6 address defined"
|
132
|
+
msgstr ""
|
97
133
|
|
98
134
|
msgid "Host has no domain defined"
|
99
135
|
msgstr "主機尚未定義區域"
|
@@ -119,12 +155,18 @@ msgstr "建立 ISO 失敗"
|
|
119
155
|
msgid "ISO generation command"
|
120
156
|
msgstr ""
|
121
157
|
|
122
|
-
msgid "ISO hybrid conversion failed"
|
123
|
-
msgstr "
|
158
|
+
msgid "ISO hybrid conversion failed: %s"
|
159
|
+
msgstr ""
|
124
160
|
|
125
161
|
msgid "ISOLINUX directory"
|
126
162
|
msgstr ""
|
127
163
|
|
164
|
+
msgid "Import Puppet classes"
|
165
|
+
msgstr "匯入 Puppet 類別"
|
166
|
+
|
167
|
+
msgid "Import facts"
|
168
|
+
msgstr "匯入詳情"
|
169
|
+
|
128
170
|
msgid "Installation media caching"
|
129
171
|
msgstr ""
|
130
172
|
|
@@ -134,6 +176,9 @@ msgstr "安裝媒介檔案將會被快取以作為完整的主機映像檔"
|
|
134
176
|
msgid "Once chainloaded, the OS bootloader and installer are downloaded directly from the installation media configured in Foreman, and the provisioning script (kickstart/preseed) is downloaded from Foreman."
|
135
177
|
msgstr "在 chainload 之後,OS 開機載入程式和安裝程式將會直接從 Foreman 中所配置的安裝媒介下載,而佈建 script(kickstart/preseed)則會由 Foreman 下載。"
|
136
178
|
|
179
|
+
msgid "Path to directory containing grubx64.efi and shimx64.efi"
|
180
|
+
msgstr ""
|
181
|
+
|
137
182
|
msgid "Path to directory containing iPXE images"
|
138
183
|
msgstr "包含 iPXE 映像檔的目錄之路徑"
|
139
184
|
|
@@ -155,6 +200,9 @@ msgstr ""
|
|
155
200
|
msgid "Plugin for Foreman that creates iPXE-based boot disks to provision hosts without the need for PXE infrastructure."
|
156
201
|
msgstr "能建立基於 iPXE 的開機磁碟的 Foreman 外掛程式,以在不需要 PXE 設備的情況下佈建主機。"
|
157
202
|
|
203
|
+
msgid "Remote action:"
|
204
|
+
msgstr "遠端動作:"
|
205
|
+
|
158
206
|
msgid "SYSLINUX directory"
|
159
207
|
msgstr ""
|
160
208
|
|
@@ -188,10 +236,13 @@ msgstr "「true」代表完整,「false」則代表可重複使用的基本映
|
|
188
236
|
msgid "Unable to find template specified by %s setting"
|
189
237
|
msgstr "找不到 %s 設定所指定的範本"
|
190
238
|
|
191
|
-
msgid "Unable to generate disk
|
239
|
+
msgid "Unable to generate disk %{kind} template: %{error}"
|
240
|
+
msgstr ""
|
241
|
+
|
242
|
+
msgid "Unable to generate disk template, %{kind} template not found."
|
192
243
|
msgstr ""
|
193
244
|
|
194
|
-
msgid "Unable to
|
245
|
+
msgid "Unable to mcopy %{path}"
|
195
246
|
msgstr ""
|
196
247
|
|
197
248
|
msgid "Upload ISO image to datastore for %s"
|
data/release-gem
CHANGED
@@ -5,33 +5,67 @@ require 'test_plugin_helper'
|
|
5
5
|
class ForemanBootdisk::Api::V2::DisksControllerTest < ActionController::TestCase
|
6
6
|
include ForemanBootdiskTestHelper
|
7
7
|
setup :setup_bootdisk
|
8
|
+
setup :setup_referer
|
9
|
+
setup :setup_org_loc
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
11
|
+
def perform_generic_generate
|
12
|
+
tmp = create_tempfile
|
13
|
+
ForemanBootdisk::ISOGenerator.expects(:generate).yields(create_tempfile.path)
|
12
14
|
get :generic
|
13
15
|
assert_response :success
|
14
|
-
|
16
|
+
ensure
|
17
|
+
tmp.unlink
|
15
18
|
end
|
16
19
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
+
def perform_host_generate
|
21
|
+
tmp = create_tempfile
|
22
|
+
ForemanBootdisk::ISOGenerator.expects(:generate).yields(create_tempfile.path)
|
23
|
+
get :host, params: { id: @host.name }
|
24
|
+
assert_response :success
|
25
|
+
ensure
|
26
|
+
tmp.unlink
|
27
|
+
end
|
28
|
+
|
29
|
+
def perform_full_host_generate
|
30
|
+
tmp = create_tempfile
|
31
|
+
ForemanBootdisk::ISOGenerator.expects(:generate_full_host).yields(create_tempfile.path)
|
32
|
+
get :host, params: { id: @host.name, full: true }
|
33
|
+
assert_response :success
|
34
|
+
ensure
|
35
|
+
tmp.unlink
|
36
|
+
end
|
37
|
+
|
38
|
+
describe '#generic with TFTP' do
|
39
|
+
setup :setup_subnet_with_tftp
|
40
|
+
setup :setup_host
|
41
|
+
|
42
|
+
test 'should generate generic image' do
|
43
|
+
perform_generic_generate
|
44
|
+
end
|
45
|
+
|
46
|
+
test 'should generate host image' do
|
47
|
+
perform_host_generate
|
48
|
+
end
|
49
|
+
|
50
|
+
test 'should generate full host image' do
|
51
|
+
perform_full_host_generate
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe '#subnet_host with TFTP and HTTPBOOT' do
|
56
|
+
setup :setup_subnet_with_tftp_httpboot_template
|
57
|
+
setup :setup_host
|
58
|
+
|
59
|
+
test 'should generate generic image' do
|
60
|
+
perform_generic_generate
|
61
|
+
end
|
20
62
|
|
21
63
|
test 'should generate host image' do
|
22
|
-
|
23
|
-
@controller.expects(:read_file).with('temp ISO').returns('ISO image')
|
24
|
-
get :host, params: { id: @host.name }
|
25
|
-
assert_response :success
|
26
|
-
assert_equal 'ISO image', @response.body
|
64
|
+
perform_host_generate
|
27
65
|
end
|
28
66
|
|
29
67
|
test 'should generate full host image' do
|
30
|
-
|
31
|
-
@controller.expects(:read_file).with('temp ISO').returns('ISO image')
|
32
|
-
get :host, params: { id: @host.name, full: true }
|
33
|
-
assert_response :success
|
34
|
-
assert_equal 'ISO image', @response.body
|
68
|
+
perform_full_host_generate
|
35
69
|
end
|
36
70
|
end
|
37
71
|
|
@@ -5,20 +5,33 @@ require 'test_plugin_helper'
|
|
5
5
|
class ForemanBootdisk::Api::V2::SubnetDisksControllerTest < ActionController::TestCase
|
6
6
|
include ForemanBootdiskTestHelper
|
7
7
|
setup :setup_bootdisk
|
8
|
+
setup :setup_referer
|
9
|
+
setup :setup_org_loc
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
def perform_subnet_generate
|
12
|
+
tmp = create_tempfile
|
13
|
+
ForemanBootdisk::ISOGenerator.expects(:generate).yields(create_tempfile.path)
|
14
|
+
get :subnet, params: { id: @host.subnet.id }
|
15
|
+
assert_response :success
|
16
|
+
ensure
|
17
|
+
tmp.unlink
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#subnet_host with TFTP' do
|
21
|
+
setup :setup_subnet_with_tftp
|
22
|
+
setup :setup_host
|
23
|
+
|
24
|
+
test 'should generate subnet generic host image' do
|
25
|
+
perform_subnet_generate
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#subnet_host with TFTP and HTTPBOOT' do
|
30
|
+
setup :setup_subnet_with_tftp_httpboot_template
|
13
31
|
setup :setup_host
|
14
32
|
|
15
33
|
test 'should generate subnet generic host image' do
|
16
|
-
|
17
|
-
ForemanBootdisk::Renderer.any_instance.stubs(:bootdisk_chain_url).yields('http://smart-proxy.lan')
|
18
|
-
File.expects(:read).with('temp ISO').returns('ISO image')
|
19
|
-
get :subnet, params: { id: @host.subnet.id }
|
20
|
-
assert_response :success
|
21
|
-
assert_equal 'ISO image', @response.body
|
34
|
+
perform_subnet_generate
|
22
35
|
end
|
23
36
|
end
|
24
37
|
end
|