|
29 | 29 | before do
|
30 | 30 | stub_command("mount | grep ' /lustre_shared_dir_with_no_mount '").and_return(false)
|
31 | 31 | stub_command("mount | grep ' /lustre_shared_dir_with_mount '").and_return(true)
|
| 32 | + allow_any_instance_of(Object).to receive(:aws_domain_for_fsx).and_return("AWS_DOMAIN_FOR_FSX") |
32 | 33 | end
|
33 | 34 |
|
34 | 35 | it 'creates_shared_dir' do
|
|
58 | 59 |
|
59 | 60 | it 'enables shared dir mount if already mounted' do
|
60 | 61 | is_expected.to enable_mount('/lustre_shared_dir_with_mount')
|
61 |
| - .with(device: 'lustre_id_2.fsx.REGION.amazonaws.com@tcp:/lustre_mount_name_2') |
| 62 | + .with(device: 'lustre_id_2.fsx.REGION.AWS_DOMAIN_FOR_FSX@tcp:/lustre_mount_name_2') |
62 | 63 | .with(fstype: 'lustre')
|
63 | 64 | .with(dump: 0)
|
64 | 65 | .with(pass: 0)
|
|
113 | 114 | before do
|
114 | 115 | stub_command("mount | grep ' /filecache_shared_dir_1 '").and_return(false)
|
115 | 116 | stub_command("mount | grep ' /filecache_shared_dir_2 '").and_return(true)
|
| 117 | + allow_any_instance_of(Object).to receive(:aws_domain_for_fsx).and_return("AWS_DOMAIN_FOR_FSX") |
116 | 118 | end
|
117 | 119 |
|
118 | 120 | it 'creates_shared_dir' do
|
|
196 | 198 | before do
|
197 | 199 | stub_command("mount | grep ' /openzfs_shared_dir_1 '").and_return(false)
|
198 | 200 | stub_command("mount | grep ' /openzfs_shared_dir_2 '").and_return(true)
|
| 201 | + allow_any_instance_of(Object).to receive(:aws_domain_for_fsx).and_return("AWS_DOMAIN_FOR_FSX") |
199 | 202 | end
|
200 | 203 |
|
201 | 204 | it 'creates_shared_dir' do
|
|
225 | 228 |
|
226 | 229 | it 'enables shared dir mount if already mounted' do
|
227 | 230 | is_expected.to enable_mount('/openzfs_shared_dir_2')
|
228 |
| - .with(device: 'openzfs_id_2.fsx.REGION.amazonaws.com:/junction_path_2') |
| 231 | + .with(device: 'openzfs_id_2.fsx.REGION.AWS_DOMAIN_FOR_FSX:/junction_path_2') |
229 | 232 | .with(fstype: 'nfs')
|
230 | 233 | .with(dump: 0)
|
231 | 234 | .with(pass: 0)
|
|
272 | 275 | before do
|
273 | 276 | stub_command("mount | grep ' /ontap_shared_dir_1 '").and_return(false)
|
274 | 277 | stub_command("mount | grep ' /ontap_shared_dir_2 '").and_return(true)
|
| 278 | + allow_any_instance_of(Object).to receive(:aws_domain_for_fsx).and_return("AWS_DOMAIN_FOR_FSX") |
275 | 279 | end
|
276 | 280 |
|
277 | 281 | it 'creates_shared_dir' do
|
|
301 | 305 |
|
302 | 306 | it 'enables shared dir mount if already mounted' do
|
303 | 307 | is_expected.to enable_mount('/ontap_shared_dir_2')
|
304 |
| - .with(device: 'ontap_id_2.fsx.REGION.amazonaws.com:/junction_path_2') |
| 308 | + .with(device: 'ontap_id_2.fsx.REGION.AWS_DOMAIN_FOR_FSX:/junction_path_2') |
305 | 309 | .with(fstype: 'nfs')
|
306 | 310 | .with(dump: 0)
|
307 | 311 | .with(pass: 0)
|
|
366 | 370 | allow(Dir).to receive(:empty?).with("/shared_dir_1").and_return(true)
|
367 | 371 | allow(Dir).to receive(:exist?).with("/shared_dir_2").and_return(true)
|
368 | 372 | allow(Dir).to receive(:empty?).with("/shared_dir_2").and_return(false)
|
| 373 | + allow_any_instance_of(Object).to receive(:aws_domain_for_fsx).and_return("AWS_DOMAIN_FOR_FSX") |
369 | 374 | end
|
370 | 375 |
|
371 | 376 | it 'unmounts fsx only if mounted' do
|
|
383 | 388 | .with(path: "/etc/fstab")
|
384 | 389 | .with(pattern: "dns_name@tcp:/mount_name_1 *")
|
385 | 390 |
|
386 |
| - is_expected.to edit_delete_lines('remove volume lustre_id_2.fsx.REGION.amazonaws.com@tcp:/mount_name_2 from /etc/fstab') |
| 391 | + is_expected.to edit_delete_lines('remove volume lustre_id_2.fsx.REGION.AWS_DOMAIN_FOR_FSX@tcp:/mount_name_2 from /etc/fstab') |
387 | 392 | .with(path: "/etc/fstab")
|
388 |
| - .with(pattern: "lustre_id_2.fsx.REGION.amazonaws.com@tcp:/mount_name_2 *") |
| 393 | + .with(pattern: "lustre_id_2.fsx.REGION.AWS_DOMAIN_FOR_FSX@tcp:/mount_name_2 *") |
389 | 394 | end
|
390 | 395 |
|
391 | 396 | it 'deletes shared dir only if it exists and it is empty' do
|
|
423 | 428 | allow(Dir).to receive(:empty?).with("/shared_dir_1").and_return(true)
|
424 | 429 | allow(Dir).to receive(:exist?).with("/shared_dir_2").and_return(true)
|
425 | 430 | allow(Dir).to receive(:empty?).with("/shared_dir_2").and_return(false)
|
| 431 | + allow_any_instance_of(Object).to receive(:aws_domain_for_fsx).and_return("AWS_DOMAIN_FOR_FSX") |
426 | 432 | end
|
427 | 433 |
|
428 | 434 | it 'unmounts fsx only if mounted' do
|
|
440 | 446 | .with(path: "/etc/fstab")
|
441 | 447 | .with(pattern: "dns_name:/junction_path_1 *")
|
442 | 448 |
|
443 |
| - is_expected.to edit_delete_lines('remove volume ontap_id_2.fsx.REGION.amazonaws.com:/junction_path_2 from /etc/fstab') |
| 449 | + is_expected.to edit_delete_lines('remove volume ontap_id_2.fsx.REGION.AWS_DOMAIN_FOR_FSX:/junction_path_2 from /etc/fstab') |
444 | 450 | .with(path: "/etc/fstab")
|
445 |
| - .with(pattern: "ontap_id_2.fsx.REGION.amazonaws.com:/junction_path_2 *") |
| 451 | + .with(pattern: "ontap_id_2.fsx.REGION.AWS_DOMAIN_FOR_FSX:/junction_path_2 *") |
446 | 452 | end
|
447 | 453 |
|
448 | 454 | it 'deletes shared dir only if it exists and it is empty' do
|
|
480 | 486 | allow(Dir).to receive(:empty?).with("/filecache_dir_1").and_return(true)
|
481 | 487 | allow(Dir).to receive(:exist?).with("/filecache_dir_2").and_return(true)
|
482 | 488 | allow(Dir).to receive(:empty?).with("/filecache_dir_2").and_return(false)
|
| 489 | + allow_any_instance_of(Object).to receive(:aws_domain_for_fsx).and_return("AWS_DOMAIN_FOR_FSX") |
483 | 490 | end
|
484 | 491 |
|
485 | 492 | it 'unmounts fsx only if mounted' do
|
|
0 commit comments