summaryrefslogtreecommitdiff
path: root/test/integration/targets/win_format
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/win_format')
-rw-r--r--test/integration/targets/win_format/aliases3
-rw-r--r--test/integration/targets/win_format/meta/main.yml2
-rw-r--r--test/integration/targets/win_format/tasks/main.yml7
-rw-r--r--test/integration/targets/win_format/tasks/pre_test.yml21
-rw-r--r--test/integration/targets/win_format/tasks/tests.yml182
-rw-r--r--test/integration/targets/win_format/templates/partition_creation_script.j211
-rw-r--r--test/integration/targets/win_format/templates/partition_deletion_script.j23
7 files changed, 0 insertions, 229 deletions
diff --git a/test/integration/targets/win_format/aliases b/test/integration/targets/win_format/aliases
deleted file mode 100644
index 3aa71f86ab..0000000000
--- a/test/integration/targets/win_format/aliases
+++ /dev/null
@@ -1,3 +0,0 @@
-shippable/windows/group4
-skip/windows/2008
-skip/windows/2008-R2
diff --git a/test/integration/targets/win_format/meta/main.yml b/test/integration/targets/win_format/meta/main.yml
deleted file mode 100644
index 9f37e96cd9..0000000000
--- a/test/integration/targets/win_format/meta/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-dependencies:
-- setup_remote_tmp_dir
diff --git a/test/integration/targets/win_format/tasks/main.yml b/test/integration/targets/win_format/tasks/main.yml
deleted file mode 100644
index de773469df..0000000000
--- a/test/integration/targets/win_format/tasks/main.yml
+++ /dev/null
@@ -1,7 +0,0 @@
----
-- name: Check if Format-Volume is supported
- win_shell: if (Get-Command -Name Format-Volume -ErrorAction SilentlyContinue) { $true } else { $false }
- register: module_present
-
-- include: pre_test.yml
- when: module_present.stdout | trim | bool
diff --git a/test/integration/targets/win_format/tasks/pre_test.yml b/test/integration/targets/win_format/tasks/pre_test.yml
deleted file mode 100644
index edc59ae52c..0000000000
--- a/test/integration/targets/win_format/tasks/pre_test.yml
+++ /dev/null
@@ -1,21 +0,0 @@
----
-- set_fact:
- AnsibleVhdx: '{{ remote_tmp_dir }}\AnsiblePart.vhdx'
-
-- name: Copy VHDX scripts
- win_template:
- src: "{{ item.src }}"
- dest: '{{ remote_tmp_dir }}\{{ item.dest }}'
- loop:
- - { src: partition_creation_script.j2, dest: partition_creation_script.txt }
- - { src: partition_deletion_script.j2, dest: partition_deletion_script.txt }
-
-- name: Create partition
- win_command: diskpart.exe /s {{ remote_tmp_dir }}\partition_creation_script.txt
-
-- name: Run tests
- block:
- - include: tests.yml
- always:
- - name: Detach disk
- win_command: diskpart.exe /s {{ remote_tmp_dir }}\partition_deletion_script.txt
diff --git a/test/integration/targets/win_format/tasks/tests.yml b/test/integration/targets/win_format/tasks/tests.yml
deleted file mode 100644
index 5036164eab..0000000000
--- a/test/integration/targets/win_format/tasks/tests.yml
+++ /dev/null
@@ -1,182 +0,0 @@
----
-- win_shell: $AnsiPart = Get-Partition -DriveLetter T; $AnsiVol = Get-Volume -DriveLetter T; "$($AnsiPart.Size),$($AnsiVol.Size)"
- register: shell_result
-
-- name: Assert volume size is 0 for pristine volume
- assert:
- that:
- - shell_result.stdout | trim == "2096037888,0"
-
-- name: Get partition access path
- win_shell: (Get-Partition -DriveLetter T).AccessPaths[1]
- register: shell_partition_result
-
-- name: Try to format using mutually exclusive parameters
- win_format:
- drive_letter: T
- path: "{{ shell_partition_result.stdout | trim }}"
- register: format_mutex_result
- ignore_errors: True
-
-- assert:
- that:
- - format_mutex_result is failed
- - 'format_mutex_result.msg == "parameters are mutually exclusive: drive_letter, path, label"'
-
-- name: Fully format volume and assign label (check)
- win_format:
- drive_letter: T
- new_label: Formatted
- full: True
- allocation_unit_size: 8192
- register: format_result_check
- check_mode: True
-
-- win_shell: $AnsiPart = Get-Partition -DriveLetter T; $AnsiVol = Get-Volume -DriveLetter T; "$($AnsiPart.Size),$($AnsiVol.Size),$($AnsiVol.FileSystemLabel),$((Get-CimInstance -ClassName Win32_Volume -Filter "DriveLetter = 'T:'" -Property BlockSize).BlockSize)"
- register: formatted_value_result_check
-
-- name: Fully format volume and assign label
- win_format:
- drive_letter: T
- new_label: Formatted
- full: True
- allocation_unit_size: 8192
- register: format_result
-
-- win_shell: $AnsiPart = Get-Partition -DriveLetter T; $AnsiVol = Get-Volume -DriveLetter T; "$($AnsiPart.Size),$($AnsiVol.Size),$($AnsiVol.FileSystemLabel),$((Get-CimInstance -ClassName Win32_Volume -Filter "DriveLetter = 'T:'" -Property BlockSize).BlockSize)"
- register: formatted_value_result
-
-- assert:
- that:
- - format_result_check is changed
- - format_result is changed
- - formatted_value_result_check.stdout | trim == "2096037888,0,,"
- - formatted_value_result.stdout | trim == "2096037888,2096029696,Formatted,8192"
-
-- name: Format NTFS volume with integrity streams enabled
- win_format:
- path: "{{ shell_partition_result.stdout | trim }}"
- file_system: ntfs
- integrity_streams: True
- ignore_errors: True
- register: ntfs_integrity_streams
-
-- assert:
- that:
- - ntfs_integrity_streams is failed
- - 'ntfs_integrity_streams.msg == "Integrity streams can be enabled only on ReFS volumes. You specified: ntfs"'
-
-- name: Format volume (require force_format for specifying different file system)
- win_format:
- path: "{{ shell_partition_result.stdout | trim }}"
- file_system: fat32
- ignore_errors: True
- register: require_force_format
-
-- assert:
- that:
- - require_force_format is failed
- - 'require_force_format.msg == "Force format must be specified since target file system: fat32 is different from the current file system of the volume: ntfs"'
-
-- name: Format volume (forced) (check)
- win_format:
- path: "{{ shell_partition_result.stdout | trim }}"
- file_system: refs
- force: True
- check_mode: True
- ignore_errors: True
- register: not_pristine_forced_check
-
-- name: Format volume (forced)
- win_format:
- path: "{{ shell_partition_result.stdout | trim }}"
- file_system: refs
- force: True
- register: not_pristine_forced
-
-- name: Format volume (forced) (idempotence will not work)
- win_format:
- path: "{{ shell_partition_result.stdout | trim }}"
- file_system: refs
- force: True
- register: not_pristine_forced_idem_fails
-
-- name: Format volume (idempotence)
- win_format:
- path: "{{ shell_partition_result.stdout | trim }}"
- file_system: refs
- register: not_pristine_forced_idem
-
-- assert:
- that:
- - not_pristine_forced_check is changed
- - not_pristine_forced is changed
- - not_pristine_forced_idem_fails is changed
- - not_pristine_forced_idem is not changed
-
-- name: Add a file
- win_file:
- path: T:\path\to\directory
- state: directory
-
-- name: Format volume with file inside without force and same fs
- win_format:
- path: "{{ shell_partition_result.stdout | trim }}"
- register: format_volume_without_force_same_fs
-
-- name: Format volume (forced) - to test case for files existing and a different fs
- win_format:
- path: "{{ shell_partition_result.stdout | trim }}"
- file_system: ntfs
- force: True
-
-- name: Add a file
- win_file:
- path: T:\path\to\directory
- state: directory
- register: add_file_to_volume
-
-- name: Format volume with file inside without force
- win_format:
- path: "{{ shell_partition_result.stdout | trim }}"
- file_system: refs
- register: format_volume_without_force
- ignore_errors: True
-
-- name: Format volume with file inside with force
- win_format:
- path: "{{ shell_partition_result.stdout | trim }}"
- force: True
- register: format_volume_with_force
-
-- assert:
- that:
- - add_file_to_volume is changed
- - format_volume_without_force is failed
- - format_volume_without_force_same_fs is not changed
- - 'format_volume_without_force.msg == "Force format must be specified to format non-pristine volumes"'
- - format_volume_with_force is changed
-
-- name: Reformat using different alu without force format
- win_format:
- path: "{{ shell_partition_result.stdout | trim }}"
- allocation_unit_size: 8192
- file_system: ntfs
- register: reformat_using_alu_without_force
- ignore_errors: True
-
-- assert:
- that:
- - reformat_using_alu_without_force is failed
-
-- name: Reformat using different alu using force format
- win_format:
- path: "{{ shell_partition_result.stdout | trim }}"
- allocation_unit_size: 8192
- file_system: ntfs
- force: True
- register: reformat_using_alu_with_force
-
-- assert:
- that:
- - reformat_using_alu_with_force is changed
diff --git a/test/integration/targets/win_format/templates/partition_creation_script.j2 b/test/integration/targets/win_format/templates/partition_creation_script.j2
deleted file mode 100644
index 8e47fda95b..0000000000
--- a/test/integration/targets/win_format/templates/partition_creation_script.j2
+++ /dev/null
@@ -1,11 +0,0 @@
-create vdisk file="{{ AnsibleVhdx }}" maximum=2000 type=fixed
-
-select vdisk file="{{ AnsibleVhdx }}"
-
-attach vdisk
-
-convert mbr
-
-create partition primary
-
-assign letter="T"
diff --git a/test/integration/targets/win_format/templates/partition_deletion_script.j2 b/test/integration/targets/win_format/templates/partition_deletion_script.j2
deleted file mode 100644
index c2be9cd144..0000000000
--- a/test/integration/targets/win_format/templates/partition_deletion_script.j2
+++ /dev/null
@@ -1,3 +0,0 @@
-select vdisk file="{{ AnsibleVhdx }}"
-
-detach vdisk