Repository: dell/dellemc-openmanage-ansible-modules
Pull request #814: Integration test fix for redfish_firmware_rollback
Author: login: ABHISHEK-SINHA10
Created: 2025-03-07T06:39:36Z | Merged: 2025-03-15T16:04:51Z

# Description
A few sentences describing the overall goals of the pull request's commits.

# GitHub Issues
List the GitHub issues impacted by this PR:

| GitHub Issue # |
| -------------- |
| |

# ISSUE TYPE
<!--- Pick one below and delete the rest -->
- Bugfix Pull Request
- Docs Pull Request
- Feature Pull Request
- Test Pull Request

##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below -->

##### OUTPUT
<!--- Paste the functionality test result below -->
```paste below

```
##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->

<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below

```
# Checklist:

- [ ] I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
- [ ] I have verified that new and existing unit tests pass locally with my changes
- [ ] I have not allowed coverage numbers to degenerate
- [ ] I have maintained at least 90% code coverage
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have maintained backward compatibility


Diff:
diff --git a/tests/integration/inventory.networking b/tests/integration/inventory.networking
index 0afbfe088..927acf58d 100644
--- a/tests/integration/inventory.networking
+++ b/tests/integration/inventory.networking
@@ -1,6 +1,6 @@
 # For modules starting with idrac as prefix
 [idrac]
-iDRAC idrac_ip=xx.xx.xx.xx idrac_user=username idrac_password=password idrac_port=443 validate_certs=false
+iDRAC idrac_ip=xx.xx.xx.xx idrac_user=user idrac_password=password idrac_port=443 validate_certs=false
 
 [ome]
 OME hostname=xx.xx.xx.xx username=username password=password port=443 validate_certs=false
@@ -26,6 +26,7 @@ port=443
 validate_certs=false
 
 [all:vars]
+SKIP_DOC=true
 ansible_host=localhost
 ansible_connection=local
 ansible_become_pass=password
diff --git a/tests/integration/targets/idrac_redfish_event_subscription/tests/ansible_doc-11852.yaml b/tests/integration/targets/idrac_redfish_event_subscription/tests/ansible_doc-11852.yaml
index 5e476795c..0f91f8919 100644
--- a/tests/integration/targets/idrac_redfish_event_subscription/tests/ansible_doc-11852.yaml
+++ b/tests/integration/targets/idrac_redfish_event_subscription/tests/ansible_doc-11852.yaml
@@ -21,3 +21,5 @@
       ansible.builtin.assert:
         that: not ansible_doc.changed
   run_once: true
+  when:
+    - SKIP_DOC is not defined or not SKIP_DOC | bool
diff --git a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/_get_firmware_inventory.yml b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/_get_firmware_inventory.yml
index e934d6fa9..cffcb640e 100644
--- a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/_get_firmware_inventory.yml
+++ b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/_get_firmware_inventory.yml
@@ -1,4 +1,8 @@
 ---
+- ansible.builtin.include_role:
+    name: prepare_idrac_lifecycle_controller_status
+  ignore_errors: true
+
 - ansible.builtin.set_fact:
     url: "https://{{idrac_ip}}:{{idrac_port}}
      /redfish/v1/UpdateService/FirmwareInventory?$expand=*($levels=1)"
@@ -21,7 +25,7 @@
     return_content: true
     status_code: 200
     headers: 'Accept=application/json'
-  until: uri_res.status == 200
+  until: uri_res.status == 200 and uri_res.content != ""
   retries: 12
   delay: 5
   register: uri_res
diff --git a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/_get_job_details.yml b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/_get_job_details.yml
index abf2af82f..7e14a3c23 100644
--- a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/_get_job_details.yml
+++ b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/_get_job_details.yml
@@ -29,7 +29,8 @@
 - name: Remove odata from uri response
   ansible.builtin.set_fact:
     job_data_uri: "{{ uri_res.json | ansible.utils.remove_keys(target=
-     ['@odata', 'MessageArgs@odata.count'], matching_parameter='regex') }}"
+     ['@odata', 'MessageArgs@odata.count', 'ActualRunningStopTime',
+     'ActualRunningStartTime'], matching_parameter='regex') }}"
 
 - ansible.builtin.set_fact:
     uri_job_status: "{{ uri_job_status | default([]) + [job_data_uri] }}"
diff --git a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/all_except_bios-11897.yaml b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/all_except_bios-11897.yaml
index c002d934f..8463b57f8 100644
--- a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/all_except_bios-11897.yaml
+++ b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/all_except_bios-11897.yaml
@@ -6,10 +6,10 @@
 ---
 - name: Test that we have an iDRAC host, iDRAC username and iDRAC password
   ansible.builtin.fail:
-    msg: 'Please define the following variables: idrac_ip, idrac_user and
-     idrac_password.'
-  when: 'idrac_ip is not defined or idrac_user is not defined or idrac_password
-   is not defined'
+    msg: "Please define the following variables: idrac_ip, idrac_user and
+      idrac_password."
+  when: "idrac_ip is not defined or idrac_user is not defined or idrac_password
+    is not defined"
 
 - name: Check whether idrac IP is IPv4 or IPv6.
   ansible.builtin.set_fact:
@@ -27,40 +27,39 @@
 
 - ansible.builtin.set_fact:
     network_components_rollback: "{{ rollback_component_list |
-     intersect(network_components) }}"
+      intersect(network_components) }}"
 
 - name: Prerequisite - Check if rollback version available for network
-   components.
+    components.
   ansible.builtin.fail:
     msg: "Prerequisite not met. Rollback version not available for network
-     components"
+      components"
   when: network_components_rollback | length < 1
 
 - name: Prerequisite - Check if rollback version available for idrac.
   ansible.builtin.fail:
     msg: "Prerequisite not met. Rollback version not available for
-     'Integrated Dell Remote Access Controller' component"
+      'Integrated Dell Remote Access Controller' component"
   when: "'Integrated Dell Remote Access Controller' not in
-   rollback_component_list"
+    rollback_component_list"
 
 - name: Prerequisite - Check if rollback version available for bios.
   ansible.builtin.fail:
     msg: "Prerequisite not met. Rollback version not available for
-     'BIOS' component"
+      'BIOS' component"
   when: "'BIOS' not in rollback_component_list"
 
-
 - block:
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
         components_list: "{{ rollback_component_list |
-         reject('search', 'BIOS') }}"
+          reject('search', 'BIOS') }}"
 
     - ansible.builtin.set_fact:
         rollback_to_version_list: "{{ previous_versions }}"
 
     - name: Rollback all components firmware except bios with reboot as true
-       (Check mode - changes expected)
+        (Check mode - changes expected)
       redfish_firmware_rollback: &redfish_firmware_rollback_1
         name: "(?!BIOS).*"
         reboot: true
@@ -70,14 +69,14 @@
       check_mode: true
 
     - name: Verify task status - Rollback all components firmware except bios
-       with reboot as true (Check mode - changes expected)
+        with reboot as true (Check mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Changes found to be applied."
 
     - name: Rollback all components firmware except bios with reboot as true
-       (Normal mode)
+        (Normal mode)
       redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_1
       register: result
@@ -96,35 +95,37 @@
       with_items: "{{ job_list }}"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
         components_list: "{{ rollback_component_list |
-         reject('search', 'BIOS') }}"
+          reject('search', 'BIOS') }}"
 
     - name: Verify task status -  Rollback all components firmware except
-       bios with reboot as true (Normal mode)
+        bios with reboot as true (Normal mode)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully completed the job for
-           firmware rollback."
+            firmware rollback."
           - installed_versions | sort == rollback_to_version_list | sort
 
     - ansible.builtin.wait_for: timeout=30
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'Integrated Dell Remote Access Controller'
+        component: "Integrated Dell Remote Access Controller"
 
     - ansible.builtin.set_fact:
         idrac_rollback_to_version: "{{ previous_version }}"
 
     - name: Rollback all components firmware except bios with reboot
-       as false (Check mode - changes expected)
+        as false (Check mode - changes expected)
       dellemc.openmanage.redfish_firmware_rollback: &redfish_firmware_rollback_2
         name: "(?!BIOS).*"
         reboot: false
@@ -133,18 +134,35 @@
       check_mode: true
 
     - name: Verify task status - Rollback all components firmware except
-       bios with reboot as false (Check mode - changes expected)
+        bios with reboot as false (Check mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Changes found to be applied."
 
     - name: Rollback all components firmware except bios with reboot as
-       false (Normal mode)
+        false (Normal mode)
       dellemc.openmanage.redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_2
       register: result
 
+    - name: Perform forceful restart of the device
+      dellemc.openmanage.redfish_powerstate:
+        reset_type: "ForceRestart"
+      register: reboot_result
+
+    - name: Wait for the device power state to be On
+      ansible.builtin.uri:
+        url: "{{ powerstate_uri }}"
+        user: "{{ idrac_user }}"
+        password: "{{ idrac_password }}"
+        validate_certs: false
+        headers: "Accept=application/json"
+      register: current_powerstate
+      until: current_powerstate.json.PowerState == "On"
+      retries: 20
+      delay: 30
+
     - ansible.builtin.set_fact:
         job_list: []
         uri_job_status: []
@@ -153,8 +171,8 @@
     - ansible.builtin.set_fact:
         job_list: "{{ job_list + [item.Id] }}"
         job_status_dict: "{{ job_status_dict |
-         combine({item.Name.split('Firmware Rollback:')[1] |
-         trim: item.JobState}) }}"
+          combine({item.Name.split('Firmware Rollback:')[1] |
+          trim: item.JobState}) }}"
       loop: "{{result.job_status}}"
 
     - ansible.builtin.include_tasks: _get_job_details.yml
@@ -163,24 +181,26 @@
       with_items: "{{job_list}}"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'Integrated Dell Remote Access Controller'
+        component: "Integrated Dell Remote Access Controller"
 
     - ansible.builtin.set_fact:
         job_status_dict_keys: "{{ job_status_dict.keys() }}"
 
     - name: Verify task status -  Rollback all components firmware except bios
-       with reboot as false (Normal mode)
+        with reboot as false (Normal mode)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully scheduled the job for
-           firmware rollback."
+            firmware rollback."
           - installed_version == idrac_rollback_to_version
           - job_status_dict['Network'] == 'Scheduled'
           - '"BIOS" not in job_status_dict_keys'
@@ -191,3 +211,8 @@
       username: "{{ idrac_user }}"
       password: "{{ idrac_password }}"
       validate_certs: "{{ validate_certs }}"
+    dellemc.openmanage.redfish_powerstate:
+      baseuri: "{{ idrac_ip }}:{{ idrac_port }}"
+      username: "{{ idrac_user }}"
+      password: "{{ idrac_password }}"
+      validate_certs: "{{ validate_certs }}"
diff --git a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/all_regex-11898.yaml b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/all_regex-11898.yaml
index 8d57e0fdf..73afa483c 100644
--- a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/all_regex-11898.yaml
+++ b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/all_regex-11898.yaml
@@ -6,10 +6,10 @@
 ---
 - name: Test that we have an iDRAC host, iDRAC username and iDRAC password
   ansible.builtin.fail:
-    msg: 'Please define the following variables: idrac_ip, idrac_user and
-     idrac_password.'
-  when: 'idrac_ip is not defined or idrac_user is not defined or idrac_password
-   is not defined'
+    msg: "Please define the following variables: idrac_ip, idrac_user and
+      idrac_password."
+  when: "idrac_ip is not defined or idrac_user is not defined or idrac_password
+    is not defined"
 
 - name: Check whether idrac IP is IPv4 or IPv6.
   ansible.builtin.set_fact:
@@ -27,26 +27,26 @@
 
 - ansible.builtin.set_fact:
     network_components_rollback: "{{ rollback_component_list |
-     intersect(network_components) }}"
+      intersect(network_components) }}"
 
 - name: Prerequisite - Check if rollback version available for network
-   components.
+    components.
   ansible.builtin.fail:
     msg: "Prerequisite not met. Rollback version not available for
-     network components"
+      network components"
   when: network_components_rollback | length < 1
 
 - name: Prerequisite - Check if rollback version available for idrac.
   ansible.builtin.fail:
     msg: "Prerequisite not met. Rollback version not available for
-     'Integrated Dell Remote Access Controller' component"
+      'Integrated Dell Remote Access Controller' component"
   when: "'Integrated Dell Remote Access Controller' not in
-   rollback_component_list"
+    rollback_component_list"
 
 - name: Prerequisite - Check if rollback version available for bios.
   ansible.builtin.fail:
     msg: "Prerequisite not met. Rollback version not available for
-     'BIOS' component"
+      'BIOS' component"
   when: "'BIOS' not in rollback_component_list"
 
 - block:
@@ -58,7 +58,7 @@
         rollback_to_version_list: "{{ previous_versions }}"
 
     - name: Rollback all components firmware with reboot as true
-       (Check mode - changes expected)
+        (Check mode - changes expected)
       redfish_firmware_rollback: &redfish_firmware_rollback_1
         name: ".*"
         reboot: true
@@ -68,7 +68,7 @@
       check_mode: true
 
     - name: Verify task status - Rollback all components firmware with
-       reboot as true (Check mode - changes expected)
+        reboot as true (Check mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
@@ -93,7 +93,9 @@
       with_items: "{{ job_list }}"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
@@ -102,25 +104,25 @@
         components_list: "{{ rollback_component_list }}"
 
     - name: Verify task status -  Rollback all components firmware with
-       reboot as true (Normal mode)
+        reboot as true (Normal mode)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully completed the job for firmware
-           rollback."
+            rollback."
           - installed_versions | sort == rollback_to_version_list | sort
 
     - ansible.builtin.wait_for: timeout=30
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'Integrated Dell Remote Access Controller'
+        component: "Integrated Dell Remote Access Controller"
 
     - ansible.builtin.set_fact:
         idrac_rollback_to_version: "{{ previous_version }}"
 
     - name: Rollback all components firmware with reboot as false
-       (Check mode - changes expected)
+        (Check mode - changes expected)
       redfish_firmware_rollback: &redfish_firmware_rollback_2
         name: ".*"
         reboot: false
@@ -129,7 +131,7 @@
       check_mode: true
 
     - name: Verify task status - Rollback all components firmware with
-       reboot as false (Check mode - changes expected)
+        reboot as false (Check mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
@@ -140,6 +142,23 @@
         <<: *redfish_firmware_rollback_2
       register: result
 
+    - name: Perform forceful restart of the device
+      dellemc.openmanage.redfish_powerstate:
+        reset_type: "ForceRestart"
+      register: reboot_result
+
+    - name: Wait for the device power state to be On
+      ansible.builtin.uri:
+        url: "{{ powerstate_uri }}"
+        user: "{{ idrac_user }}"
+        password: "{{ idrac_password }}"
+        validate_certs: false
+        headers: "Accept=application/json"
+      register: current_powerstate
+      until: current_powerstate.json.PowerState == "On"
+      retries: 20
+      delay: 30
+
     - ansible.builtin.set_fact:
         job_list: []
         uri_job_status: []
@@ -148,8 +167,8 @@
     - ansible.builtin.set_fact:
         job_list: "{{ job_list + [item.Id] }}"
         job_status_dict: "{{ job_status_dict |
-         combine({item.Name.split('Firmware Rollback:')[1] |
-         trim: item.JobState}) }}"
+          combine({item.Name.split('Firmware Rollback:')[1] |
+          trim: item.JobState}) }}"
       loop: "{{ result.job_status }}"
 
     - ansible.builtin.include_tasks: _get_job_details.yml
@@ -158,24 +177,26 @@
       with_items: "{{ job_list }}"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'Integrated Dell Remote Access Controller'
+        component: "Integrated Dell Remote Access Controller"
 
     - name: Verify task status -  Rollback all components firmware
-       with reboot as false (Normal mode)
+        with reboot as false (Normal mode)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully scheduled the job for firmware
-           rollback."
+            rollback."
           - installed_version == idrac_rollback_to_version
           - job_status_dict['BIOS'] == job_status_dict['Network'] ==
-           'Scheduled'
+            'Scheduled'
 
   module_defaults:
     dellemc.openmanage.redfish_firmware_rollback:
@@ -183,3 +204,8 @@
       username: "{{ idrac_user }}"
       password: "{{ idrac_password }}"
       validate_certs: "{{ validate_certs }}"
+    dellemc.openmanage.redfish_powerstate:
+      baseuri: "{{ idrac_ip }}:{{ idrac_port }}"
+      username: "{{ idrac_user }}"
+      password: "{{ idrac_password }}"
+      validate_certs: "{{ validate_certs }}"
diff --git a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/ansible_doc-11889.yaml b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/ansible_doc-11889.yaml
index 86a7661fa..abd0eb139 100644
--- a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/ansible_doc-11889.yaml
+++ b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/ansible_doc-11889.yaml
@@ -21,3 +21,5 @@
       ansible.builtin.assert:
         that: not ansible_doc.changed
   run_once: true
+  when:
+    - SKIP_DOC is not defined or not SKIP_DOC | bool
diff --git a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/bios-11893.yaml b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/bios-11893.yaml
index 282347781..2d298fc62 100644
--- a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/bios-11893.yaml
+++ b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/bios-11893.yaml
@@ -6,10 +6,10 @@
 ---
 - name: Test that we have an iDRAC host, iDRAC username and iDRAC password
   ansible.builtin.fail:
-    msg: 'Please define the following variables: idrac_ip, idrac_user and
-     idrac_password.'
-  when: 'idrac_ip is not defined or idrac_user is not defined or idrac_password
-   is not defined'
+    msg: "Please define the following variables: idrac_ip, idrac_user and
+      idrac_password."
+  when: "idrac_ip is not defined or idrac_user is not defined or idrac_password
+    is not defined"
 
 - name: Check whether idrac IP is IPv4 or IPv6.
   ansible.builtin.set_fact:
@@ -23,20 +23,19 @@
 
 - ansible.builtin.include_tasks: _prereq_helper.yml
   vars:
-    comp: 'BIOS'
+    comp: "BIOS"
   when: '"BIOS" not in rollback_component_list'
 
 - block:
-
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'BIOS'
+        component: "BIOS"
 
     - ansible.builtin.set_fact:
         rollback_to_version: "{{ previous_version }}"
 
     - name: Rollback an BIOS component firmware with reboot as false
-       (Check mode - changes expected)
+        (Check mode - changes expected)
       redfish_firmware_rollback: &redfish_firmware_rollback_1
         name: BIOS
         reboot: false
@@ -45,14 +44,14 @@
       check_mode: true
 
     - name: Verify task status - Rollback an BIOS component firmware with
-       reboot as false (Check mode - changes expected)
+        reboot as false (Check mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Changes found to be applied."
 
     - name: Rollback an BIOS component firmware with reboot as false
-       (Normal mode)
+        (Normal mode)
       dellemc.openmanage.redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_1
       register: result
@@ -65,19 +64,21 @@
         job_id: "{{ result.job_status[0].Id }}"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
     - name: Verify task status - Rollback an BIOS component firmware
-       with reboot as false (Normal mode)
+        with reboot as false (Normal mode)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully scheduled the job for firmware
-           rollback."
+            rollback."
 
-    - name: Perform graceful restart of the device
+    - name: Perform forceful restart of the device
       dellemc.openmanage.redfish_powerstate:
         reset_type: "ForceRestart"
       register: reboot_result
@@ -88,7 +89,7 @@
         user: "{{ idrac_user }}"
         password: "{{ idrac_password }}"
         validate_certs: false
-        headers: 'Accept=application/json'
+        headers: "Accept=application/json"
       register: current_powerstate
       until: current_powerstate.json.PowerState == "On"
       retries: 20
@@ -100,10 +101,10 @@
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'BIOS'
+        component: "BIOS"
 
     - name: Verify firmware version of BIOS component post rollback with
-       reboot as false (Normal mode)
+        reboot as false (Normal mode)
       ansible.builtin.assert:
         that:
           - installed_version == rollback_to_version
@@ -112,14 +113,14 @@
         rollback_to_version: "{{ previous_version }}"
 
     - name: Rollback an BIOS component firmware with reboot as false
-       (Check mode again - changes expected)
+        (Check mode again - changes expected)
       dellemc.openmanage.redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_1
       register: result
       check_mode: true
 
     - name: Verify task status - Rollback an BIOS component firmware with
-       reboot as false (Check mode again - changes expected)
+        reboot as false (Check mode again - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
@@ -128,7 +129,7 @@
     - ansible.builtin.wait_for: timeout=30
 
     - name: Rollback an BIOS component firmware with reboot as false
-       (Idempotence mode - changes expected)
+        (Idempotence mode - changes expected)
       dellemc.openmanage.redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_1
       register: result
@@ -141,20 +142,22 @@
         job_id: "{{ result.job_status[0].Id }}"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
     - name: Verify task status - Rollback an BIOS component firmware with
-       reboot as false (Idempotence mode - changes expected)
+        reboot as false (Idempotence mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully scheduled the job for firmware
-           rollback."
+            rollback."
 
-    - name: Perform graceful restart of the device
-      redfish_powerstate:
+    - name: Perform forceful restart of the device
+      dellemc.openmanage.redfish_powerstate:
         reset_type: "ForceRestart"
       register: reboot_result
 
@@ -164,7 +167,7 @@
         user: "{{ idrac_user }}"
         password: "{{ idrac_password }}"
         validate_certs: false
-        headers: 'Accept=application/json'
+        headers: "Accept=application/json"
       register: current_powerstate
       until: current_powerstate.json.PowerState == "On"
       retries: 20
@@ -176,10 +179,10 @@
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'BIOS'
+        component: "BIOS"
 
     - name: Verify firmware version of BIOS component post rollback with
-       reboot as false (Idempotence mode - changes expected)
+        reboot as false (Idempotence mode - changes expected)
       ansible.builtin.assert:
         that:
           - installed_version == rollback_to_version
@@ -188,7 +191,7 @@
         rollback_to_version: "{{ previous_version }}"
 
     - name: Rollback an BIOS component firmware with reboot as true and
-       non-default reboot_timeout (Check mode - changes expected)
+        non-default reboot_timeout (Check mode - changes expected)
       redfish_firmware_rollback: &redfish_firmware_rollback_2
         name: BIOS
         reboot: true
@@ -198,8 +201,8 @@
       check_mode: true
 
     - name: Verify task status - Rollback an BIOS component firmware with
-       reboot as true and non-default reboot_timeout
-       (Check mode - changes expected)
+        reboot as true and non-default reboot_timeout
+        (Check mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
@@ -208,7 +211,7 @@
     - ansible.builtin.wait_for: timeout=30
 
     - name: Rollback an BIOS component firmware with reboot as true
-       and non-default reboot_timeout (Normal mode)
+        and non-default reboot_timeout (Normal mode)
       redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_2
       register: result
@@ -222,32 +225,34 @@
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'BIOS'
+        component: "BIOS"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
     - name: Verify task status - Rollback an BIOS component firmware with
-       reboot as true and non-default reboot_timeout (Normal mode)
+        reboot as true and non-default reboot_timeout (Normal mode)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully completed the job for firmware
-           rollback."
+            rollback."
           - installed_version == rollback_to_version
 
     - name: Rollback an BIOS component firmware with reboot as true and
-       non-default reboot_timeout (Check mode again - changes expected)
+        non-default reboot_timeout (Check mode again - changes expected)
       dellemc.openmanage.redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_2
       register: result
       check_mode: true
 
     - name: Verify task status - Rollback an BIOS component firmware with
-       reboot as true and non-default reboot_timeout
-       (Check mode again - changes expected)
+        reboot as true and non-default reboot_timeout
+        (Check mode again - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
diff --git a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/idrac-11892.yaml b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/idrac-11892.yaml
index a951d3b3c..0e9969353 100644
--- a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/idrac-11892.yaml
+++ b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/idrac-11892.yaml
@@ -6,10 +6,10 @@
 ---
 - name: Test that we have an iDRAC host, iDRAC username and iDRAC password
   ansible.builtin.fail:
-    msg: 'Please define the following variables: idrac_ip, idrac_user and
-     idrac_password.'
-  when: 'idrac_ip is not defined or idrac_user is not defined or idrac_password
-   is not defined'
+    msg: "Please define the following variables: idrac_ip, idrac_user and
+      idrac_password."
+  when: "idrac_ip is not defined or idrac_user is not defined or idrac_password
+    is not defined"
 
 - name: Check whether idrac IP is IPv4 or IPv6.
   ansible.builtin.set_fact:
@@ -20,21 +20,20 @@
 
 - ansible.builtin.include_tasks: _prereq_helper.yml
   vars:
-    comp: 'Integrated Dell Remote Access Controller'
+    comp: "Integrated Dell Remote Access Controller"
   when: '"Integrated Dell Remote Access Controller" not in
-   rollback_component_list'
+    rollback_component_list'
 
 - block:
-
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'Integrated Dell Remote Access Controller'
+        component: "Integrated Dell Remote Access Controller"
 
     - ansible.builtin.set_fact:
         rollback_to_version: "{{ previous_version }}"
 
     - name: Rollback an idrac component firmware with reboot as true
-       (Check mode - changes expected)
+        (Check mode - changes expected)
       redfish_firmware_rollback: &redfish_firmware_rollback_1
         name: "Integrated Dell Remote Access Controller"
         timeout: 300
@@ -42,14 +41,14 @@
       check_mode: true
 
     - name: Verify task status - Rollback an idrac component firmware
-       with reboot as true (Check mode - changes expected)
+        with reboot as true (Check mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Changes found to be applied."
 
     - name: Rollback an idrac component firmware with reboot as true
-       (Normal mode)
+        (Normal mode)
       dellemc.openmanage.redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_1
       register: result
@@ -58,7 +57,7 @@
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'Integrated Dell Remote Access Controller'
+        component: "Integrated Dell Remote Access Controller"
 
     - ansible.builtin.set_fact:
         uri_job_status: []
@@ -68,28 +67,30 @@
         job_id: "{{ result.job_status[0].Id }}"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
     - name: Verify task status - Rollback an idrac component firmware
-       with reboot as true (Normal mode)
+        with reboot as true (Normal mode)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully completed the job for firmware
-           rollback."
+            rollback."
           - installed_version == rollback_to_version
 
     - name: Rollback an idrac component firmware with reboot as true
-       (Check mode again - changes expected)
+        (Check mode again - changes expected)
       dellemc.openmanage.redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_1
       register: result
       check_mode: true
 
     - name: Verify task status - Rollback an idrac component firmware
-       with reboot as true (Check mode again- changes expected)
+        with reboot as true (Check mode again- changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
@@ -101,7 +102,7 @@
     - ansible.builtin.wait_for: timeout=30
 
     - name: Rollback an idrac component firmware with reboot as
-       true (Idempotence mode - changes expected)
+        true (Idempotence mode - changes expected)
       dellemc.openmanage.redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_1
       register: result
@@ -110,7 +111,7 @@
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'Integrated Dell Remote Access Controller'
+        component: "Integrated Dell Remote Access Controller"
 
     - ansible.builtin.set_fact:
         uri_job_status: []
@@ -120,24 +121,26 @@
         job_id: "{{ result.job_status[0].Id }}"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
     - name: Verify task status - Rollback an idrac component firmware
-       with reboot as true (Idempotence mode - changes expected)
+        with reboot as true (Idempotence mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully completed the job for firmware
-           rollback."
+            rollback."
           - installed_version == rollback_to_version
 
     - ansible.builtin.set_fact:
         rollback_to_version: "{{ previous_version }}"
 
     - name: Rollback an idrac component firmware with reboot as false
-       (Check mode - changes expected)
+        (Check mode - changes expected)
       redfish_firmware_rollback: &redfish_firmware_rollback_2
         name: "Integrated Dell Remote Access Controller"
         timeout: 300
@@ -146,7 +149,7 @@
       check_mode: true
 
     - name: Verify task status - Rollback an idrac component firmware with
-       reboot as false (Check mode - changes expected)
+        reboot as false (Check mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
@@ -155,11 +158,28 @@
     - ansible.builtin.wait_for: timeout=30
 
     - name: Rollback an idrac component firmware with reboot as false
-       (Normal mode)
+        (Normal mode)
       dellemc.openmanage.redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_2
       register: result
 
+    - name: Perform forceful restart of the device
+      dellemc.openmanage.redfish_powerstate:
+        reset_type: "ForceRestart"
+      register: reboot_result
+
+    - name: Wait for the device power state to be On
+      ansible.builtin.uri:
+        url: "{{ powerstate_uri }}"
+        user: "{{ idrac_user }}"
+        password: "{{ idrac_password }}"
+        validate_certs: false
+        headers: "Accept=application/json"
+      register: current_powerstate
+      until: current_powerstate.json.PowerState == "On"
+      retries: 20
+      delay: 30
+
     - ansible.builtin.set_fact:
         uri_job_status: []
 
@@ -168,21 +188,23 @@
         job_id: "{{ result.job_status[0].Id }}"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'Integrated Dell Remote Access Controller'
+        component: "Integrated Dell Remote Access Controller"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
     - name: Verify task status - Rollback an idrac component firmware
-       with reboot as false (Normal mode)
+        with reboot as false (Normal mode)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully completed the job for firmware
-           rollback."
+            rollback."
           - installed_version == rollback_to_version
 
   module_defaults:
@@ -191,3 +213,8 @@
       username: "{{ idrac_user }}"
       password: "{{ idrac_password }}"
       validate_certs: "{{ validate_certs }}"
+    dellemc.openmanage.redfish_powerstate:
+      baseuri: "{{ idrac_ip }}"
+      username: "{{ idrac_user }}"
+      password: "{{ idrac_password }}"
+      validate_certs: "{{ validate_certs }}"
diff --git a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/idrac_bios_regex-11894.yaml b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/idrac_bios_regex-11894.yaml
index 6957ed62d..8fde02c4e 100644
--- a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/idrac_bios_regex-11894.yaml
+++ b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/idrac_bios_regex-11894.yaml
@@ -6,10 +6,10 @@
 ---
 - name: Test that we have an iDRAC host, iDRAC username and iDRAC password
   ansible.builtin.fail:
-    msg: 'Please define the following variables: idrac_ip, idrac_user and
-     idrac_password.'
-  when: 'idrac_ip is not defined or idrac_user is not defined or idrac_password
-   is not defined'
+    msg: "Please define the following variables: idrac_ip, idrac_user and
+      idrac_password."
+  when: "idrac_ip is not defined or idrac_user is not defined or idrac_password
+    is not defined"
 
 - name: Check whether idrac IP is IPv4 or IPv6.
   ansible.builtin.set_fact:
@@ -21,19 +21,19 @@
 - ansible.builtin.include_tasks: _prereq_helper.yml
   vars:
     comp: "{{ item }}"
-  when: 'item not in rollback_component_list '
-  loop: ['Integrated Dell Remote Access Controller', 'BIOS']
+  when: "item not in rollback_component_list "
+  loop: ["Integrated Dell Remote Access Controller", "BIOS"]
 
 - block:
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'BIOS'
+        component: "BIOS"
 
     - ansible.builtin.set_fact:
         rollback_to_version: "{{ previous_version }}"
 
     - name: Rollback an BIOS component firmware with reboot as true
-       (Check mode - changes expected)
+        (Check mode - changes expected)
       redfish_firmware_rollback: &redfish_firmware_rollback_1
         name: "^B.*S"
         reboot_timeout: 3600
@@ -42,14 +42,14 @@
       check_mode: true
 
     - name: Verify task status - Rollback an BIOS component firmware
-       with reboot as true (Check mode - changes expected)
+        with reboot as true (Check mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Changes found to be applied."
 
     - name: Rollback an BIOS component firmware with reboot as true
-       (Normal mode)
+        (Normal mode)
       dellemc.openmanage.redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_1
       register: result
@@ -63,25 +63,27 @@
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'BIOS'
+        component: "BIOS"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
     - name: Verify task status - Rollback an BIOS component firmware
-       with reboot as true (Normal mode)
+        with reboot as true (Normal mode)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully completed the job for firmware
-           rollback."
+            rollback."
           - installed_version == rollback_to_version
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'Integrated Dell Remote Access Controller'
+        component: "Integrated Dell Remote Access Controller"
 
     - ansible.builtin.set_fact:
         rollback_to_version: "{{ previous_version }}"
@@ -89,7 +91,7 @@
     - ansible.builtin.wait_for: timeout=30
 
     - name: Rollback an idrac component firmware with reboot as true
-       (Check mode - changes expected)
+        (Check mode - changes expected)
       redfish_firmware_rollback: &redfish_firmware_rollback_2
         name: "Integra.*Ac{2}es{2} Controller$"
         reboot_timeout: 3600
@@ -98,14 +100,14 @@
       check_mode: true
 
     - name: Verify task status - Rollback an idrac component firmware
-       with reboot as true (Check mode - changes expected)
+        with reboot as true (Check mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Changes found to be applied."
 
     - name: Rollback an idrac component firmware with reboot as true
-       (Normal mode)
+        (Normal mode)
       dellemc.openmanage.redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_2
       register: result
@@ -119,20 +121,22 @@
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
-        component: 'Integrated Dell Remote Access Controller'
+        component: "Integrated Dell Remote Access Controller"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
     - name: Verify task status - Rollback an idrac component firmware
-       with reboot as true (Normal mode)
+        with reboot as true (Normal mode)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully completed the job for firmware
-           rollback."
+            rollback."
           - installed_version == rollback_to_version
 
   module_defaults:
diff --git a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/invalid_attributes-11890.yaml b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/invalid_attributes-11890.yaml
index 94b18523a..1c283b79b 100644
--- a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/invalid_attributes-11890.yaml
+++ b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/invalid_attributes-11890.yaml
@@ -6,10 +6,10 @@
 ---
 - name: Test that we have an iDRAC host, iDRAC username and iDRAC password
   ansible.builtin.fail:
-    msg: 'Please define the following variables: idrac_ip, idrac_user and
-     idrac_password.'
-  when: 'idrac_ip is not defined or idrac_user is not defined or idrac_password
-   is not defined'
+    msg: "Please define the following variables: idrac_ip, idrac_user and
+      idrac_password."
+  when: "idrac_ip is not defined or idrac_user is not defined or idrac_password
+    is not defined"
 
 - block:
     - name: Negative - unreachable host
@@ -25,7 +25,7 @@
           - invalid_unreachable.unreachable
           - not invalid_unreachable.changed
           - invalid_unreachable.msg == "<urlopen error [Errno -2]
-           Name or service not known>"
+            Name or service not known>"
 
     - name: Negative - missing required argument
       dellemc.openmanage.redfish_firmware_rollback:
@@ -38,7 +38,7 @@
           - invalid_missing_argument.failed
           - not invalid_missing_argument.changed
           - 'invalid_missing_argument.msg == "missing required arguments:
-           name"'
+            name"'
 
     - name: Negative - unsupported argument
       dellemc.openmanage.redfish_firmware_rollback:
@@ -53,10 +53,10 @@
           - invalid_unsupported_argument.failed
           - not invalid_unsupported_argument.changed
           - 'invalid_unsupported_argument.msg == "Unsupported parameters
-           for (dellemc.openmanage.redfish_firmware_rollback) module: version.
-           Supported parameters include: baseuri, ca_path, name, password,
-           reboot, reboot_timeout, timeout, username, validate_certs,
-           x_auth_token."'
+            for (dellemc.openmanage.redfish_firmware_rollback) module: version.
+            Supported parameters include: baseuri, ca_path, name, password,
+            reboot, reboot_timeout, timeout, username, validate_certs,
+            x_auth_token."'
 
     - name: Negative - invalid component name
       dellemc.openmanage.redfish_firmware_rollback:
@@ -115,8 +115,8 @@
 
     - ansible.builtin.set_fact:
         invalid_validate_certs_expected_msg: "argument 'validate_certs' is
-         of type <class 'str'> and we were unable to convert to bool: The
-         value 'invalid' is not a valid boolean.  Valid booleans include: "
+          of type <class 'str'> and we were unable to convert to bool: The
+          value 'invalid' is not a valid boolean.  Valid booleans include: "
 
     - name: Verify status of tasks
       ansible.builtin.assert:
diff --git a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/invalid_reboot-11891.yaml b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/invalid_reboot-11891.yaml
index 33c7942a2..2192dedb7 100644
--- a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/invalid_reboot-11891.yaml
+++ b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/invalid_reboot-11891.yaml
@@ -18,7 +18,7 @@
          value 'None' is not a valid boolean.  Valid booleans include: "
         string_reboot_timeout_msg: "argument 'reboot_timeout' is of
          type <class 'str'> and we were unable to convert to
-         int: <class 'str'> cannot be converted to an int"
+         int:"
 
     - name: Negative - invalid reboot
       dellemc.openmanage.redfish_firmware_rollback:
@@ -75,7 +75,7 @@
         that:
           - string_reboot_timeout.failed
           - not string_reboot_timeout.changed
-          - string_reboot_timeout.msg == string_reboot_timeout_msg
+          - string_reboot_timeout_msg in string_reboot_timeout.msg
 
     - name: Negative - invalid regular expression
       dellemc.openmanage.redfish_firmware_rollback:
diff --git a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/network_regex-11896.yaml b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/network_regex-11896.yaml
index eb9ce32f7..34a41114c 100644
--- a/tests/integration/targets/idrac_redfish_firmware_rollback/tests/network_regex-11896.yaml
+++ b/tests/integration/targets/idrac_redfish_firmware_rollback/tests/network_regex-11896.yaml
@@ -6,10 +6,10 @@
 ---
 - name: Test that we have an iDRAC host, iDRAC username and iDRAC password
   ansible.builtin.fail:
-    msg: 'Please define the following variables: idrac_ip, idrac_user and
-     idrac_password.'
-  when: 'idrac_ip is not defined or idrac_user is not defined or idrac_password
-   is not defined'
+    msg: "Please define the following variables: idrac_ip, idrac_user and
+      idrac_password."
+  when: "idrac_ip is not defined or idrac_user is not defined or idrac_password
+    is not defined"
 
 - name: Check whether idrac IP is IPv4 or IPv6.
   ansible.builtin.set_fact:
@@ -27,26 +27,25 @@
 
 - ansible.builtin.set_fact:
     network_components_rollback: "{{ rollback_component_list |
-     intersect(network_components) }}"
+      intersect(network_components) }}"
 
 - name: Prerequisite - Check if rollback version available for network
-   components.
+    components.
   ansible.builtin.fail:
     msg: "Prerequisite not met. Rollback version not available for network
-     components"
+      components"
   when: network_components_rollback | length < 1
 
-
 - block:
     - ansible.builtin.set_fact:
         rollback_components: "{{ rollback_component_list |
-         intersect(nic_comps) }}"
+          intersect(nic_comps) }}"
 
     # If NIC component rollback is not available then pick FC component for
     # rollback
     - ansible.builtin.set_fact:
         rollback_components: "{{ rollback_component_list |
-         intersect(fc_comps) }}"
+          intersect(fc_comps) }}"
       when: rollback_components | length < 1
 
     - ansible.builtin.set_fact:
@@ -58,7 +57,7 @@
 
     - ansible.builtin.set_fact:
         comp_regex: "{{ (comp_regex.split(split_by[0])[0] + '.*') if
-         (split_by | length > 0) else (comp_regex  + '.*') }}"
+          (split_by | length > 0) else (comp_regex  + '.*') }}"
 
     - ansible.builtin.include_tasks: _get_firmware_inventory.yml
       vars:
@@ -68,7 +67,7 @@
         rollback_to_version_list: "{{ previous_versions }}"
 
     - name: Rollback an network component firmware with reboot as true
-       (Check mode - changes expected)
+        (Check mode - changes expected)
       redfish_firmware_rollback: &redfish_firmware_rollback_1
         name: "{{ comp_regex }}"
         reboot_timeout: 3600
@@ -77,14 +76,14 @@
       check_mode: true
 
     - name: Verify task status - Rollback an network component firmware
-       with reboot as true (Check mode - changes expected)
+        with reboot as true (Check mode - changes expected)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Changes found to be applied."
 
     - name: Rollback an network component firmware with reboot as true
-       (Normal mode)
+        (Normal mode)
       dellemc.openmanage.redfish_firmware_rollback:
         <<: *redfish_firmware_rollback_1
       register: result
@@ -105,17 +104,19 @@
         components_list: "{{ rollback_components }}"
 
     - ansible.builtin.set_fact:
-        module_job_status: "{{ result.job_status }}"
+        module_job_status: "{{ result.job_status | ansible.utils.remove_keys(
+          target=['ActualRunningStopTime', 'ActualRunningStartTime'],
+          matching_parameter='regex') }}"
 
     - ansible.builtin.include_tasks: _assert_job_status.yml
 
     - name: Verify task status - Rollback an network component firmware
-       with reboot as true (Normal mode)
+        with reboot as true (Normal mode)
       ansible.builtin.assert:
         that:
           - result.changed
           - result.msg == "Successfully completed the job for firmware
-           rollback."
+            rollback."
           - installed_versions | sort == rollback_to_version_list | sort
 
   module_defaults:
diff --git a/tests/integration/targets/idrac_redfish_powerstate/tests/ansible_doc-11861.yaml b/tests/integration/targets/idrac_redfish_powerstate/tests/ansible_doc-11861.yaml
index 4a9410ad6..4dc63b639 100644
--- a/tests/integration/targets/idrac_redfish_powerstate/tests/ansible_doc-11861.yaml
+++ b/tests/integration/targets/idrac_redfish_powerstate/tests/ansible_doc-11861.yaml
@@ -21,3 +21,5 @@
       ansible.builtin.assert:
         that: not ansible_doc.changed
   run_once: true
+  when:
+    - SKIP_DOC is not defined or not SKIP_DOC | bool
diff --git a/tests/integration/targets/idrac_redfish_powerstate/tests/oem_reset_type_valid-11863.yaml b/tests/integration/targets/idrac_redfish_powerstate/tests/oem_reset_type_valid-11863.yaml
index 91d54e412..6da414ff3 100644
--- a/tests/integration/targets/idrac_redfish_powerstate/tests/oem_reset_type_valid-11863.yaml
+++ b/tests/integration/targets/idrac_redfish_powerstate/tests/oem_reset_type_valid-11863.yaml
@@ -18,6 +18,10 @@
       dellemc.openmanage.redfish_powerstate:
         reset_type: "GracefulShutdown"
 
+    - ansible.builtin.include_tasks: _wait_for_powerstate.yml
+      vars:
+        expected_state: "Off"
+
     - name: Fetch the iDRAC firmware version
       ansible.builtin.import_tasks: _fetch_uri.yml
       vars:
@@ -127,6 +131,15 @@
           will automatically power on."
       when: firmware_ver >= '7.00.60'
 
+  always:
+    - name: Power On the iDRAC
+      dellemc.openmanage.redfish_powerstate:
+        reset_type: "On"
+
+    - ansible.builtin.include_tasks: _wait_for_powerstate.yml
+      vars:
+        expected_state: "On"
+
   module_defaults:
     dellemc.openmanage.redfish_powerstate:
       baseuri: "{{ idrac_ip }}:{{ idrac_port }}"
diff --git a/tests/integration/targets/prepare_idrac_lifecycle_controller_status/tasks/main.yaml b/tests/integration/targets/prepare_idrac_lifecycle_controller_status/tasks/main.yaml
index 04cdcde1f..97617f83a 100644
--- a/tests/integration/targets/prepare_idrac_lifecycle_controller_status/tasks/main.yaml
+++ b/tests/integration/targets/prepare_idrac_lifecycle_controller_status/tasks/main.yaml
@@ -1,16 +1,26 @@
 ---
-- name: Module defaults
-  module_defaults:
-    dellemc.openmanage.idrac_lifecycle_controller_status_info:
-      idrac_ip: "{{ idrac_ip }}"
-      idrac_port: "{{ idrac_port }}"
-      idrac_user: "{{ idrac_user }}"
-      idrac_password: "{{ idrac_password }}"
-      validate_certs: "{{ validate_certs }}"
-
+- name: Prepare LC status wait
   block:
+    - name: Waiting for 30 secs before checking LC status
+      ansible.builtin.wait_for:
+        timeout: 30
+
+    - name: Getting LC status first time
+      dellemc.openmanage.idrac_lifecycle_controller_status_info:
+        idrac_ip: "{{ idrac_ip }}"
+        idrac_port: "{{ idrac_port }}"
+        idrac_user: "{{ idrac_user }}"
+        idrac_password: "{{ idrac_password }}"
+        validate_certs: "{{ validate_certs }}"
+      register: result_lc
+
     - name: Wait for LC to be ready
       dellemc.openmanage.idrac_lifecycle_controller_status_info:
+        idrac_ip: "{{ idrac_ip }}"
+        idrac_port: "{{ idrac_port }}"
+        idrac_user: "{{ idrac_user }}"
+        idrac_password: "{{ idrac_password }}"
+        validate_certs: "{{ validate_certs }}"
       register: result_lc
       until:
         - result_lc is defined
diff --git a/tests/integration/targets/prepare_lifecycle_contoller_job_queue/tasks/main.yml b/tests/integration/targets/prepare_lifecycle_contoller_job_queue/tasks/main.yml
index 0d82a837b..f5fe7180c 100644
--- a/tests/integration/targets/prepare_lifecycle_contoller_job_queue/tasks/main.yml
+++ b/tests/integration/targets/prepare_lifecycle_contoller_job_queue/tasks/main.yml
@@ -1,15 +1,49 @@
 ---
-- name: Module defaults
-  module_defaults:
-    dellemc.openmanage.idrac_lifecycle_controller_jobs:
-      idrac_ip: "{{ idrac_ip }}"
-      idrac_port: "{{ idrac_port }}"
-      idrac_user: "{{ idrac_user }}"
-      idrac_password: "{{ idrac_password }}"
-      validate_certs: "{{ validate_certs }}"
-
+- name: Prepare Lifecycle Controller Job Queue
+  vars:
+    expand: "?$expand=*($levels=1)"
+    job_uri: "/redfish/v1/Managers/iDRAC.Embedded.1/Jobs"
   block:
     - name: Delete LC Job Queue
       dellemc.openmanage.idrac_lifecycle_controller_jobs:
+        idrac_ip: "{{ idrac_ip }}"
+        idrac_port: "{{ idrac_port }}"
+        idrac_user: "{{ idrac_user }}"
+        idrac_password: "{{ idrac_password }}"
+        validate_certs: "{{ validate_certs }}"
       register: job_queue
       changed_when: "'Failed to delete the Job' in job_queue.msg"
+      ignore_errors: true
+
+    - name: Get all job details by uri.
+      ansible.builtin.uri:
+        url: "https://{{ idrac_ip }}{{ job_uri }}{{ expand }}"
+        user: "{{ idrac_user }}"
+        password: "{{ idrac_password }}"
+        validate_certs: "{{ validate_certs }}"
+        force_basic_auth: true
+        headers: 'Accept=application/json'
+      register: uri_all_jobs
+      when: job_queue.status.Message == "A running job cannot be deleted."
+
+    - name: Extact all the running jobs
+      ansible.builtin.set_fact:
+        job_ids: "{{ job_ids | default([]) + [item.Id if item.JobState ==
+          'Running' else []] }}"
+      loop: "{{ uri_all_jobs.json.Members }}"
+      when: job_queue.status.Message == "A running job cannot be deleted."
+
+    - name: Track running job of a Lifecycle Control job
+      dellemc.openmanage.idrac_lifecycle_controller_job_status_info:
+        idrac_ip: "{{ idrac_ip }}"
+        idrac_port: "{{ idrac_port }}"
+        idrac_user: "{{ idrac_user }}"
+        idrac_password: "{{ idrac_password }}"
+        validate_certs: "{{ validate_certs }}"
+        job_id: "{{ item }}"
+      register: job_track
+      until: job_track.job_info.JobStatus in ["Failed", "Completed"]
+      delay: 10
+      retries: 120
+      loop: "{{ job_ids }}"
+      when: job_queue.status.Message == "A running job cannot be deleted."
diff --git a/tests/integration/targets/prepare_lifecycle_controller_job/tasks/main.yaml b/tests/integration/targets/prepare_lifecycle_controller_job/tasks/main.yaml
index 7a97df16f..c46bfe298 100644
--- a/tests/integration/targets/prepare_lifecycle_controller_job/tasks/main.yaml
+++ b/tests/integration/targets/prepare_lifecycle_controller_job/tasks/main.yaml
@@ -1,16 +1,13 @@
 ---
-- name: Module defaults
-  module_defaults:
-    dellemc.openmanage.idrac_lifecycle_controller_job_status_info:
-      idrac_ip: "{{ idrac_ip }}"
-      idrac_port: "{{ idrac_port }}"
-      idrac_user: "{{ idrac_user }}"
-      idrac_password: "{{ idrac_password }}"
-      validate_certs: "{{ validate_certs }}"
-
+- name: Prepare Lifecycle Controller Job
   block:
     - name: Wait for Job to complete
       dellemc.openmanage.idrac_lifecycle_controller_job_status_info:
+        idrac_ip: "{{ idrac_ip }}"
+        idrac_port: "{{ idrac_port }}"
+        idrac_user: "{{ idrac_user }}"
+        idrac_password: "{{ idrac_password }}"
+        validate_certs: "{{ validate_certs }}"
         job_id: "{{ job_id }}"
       when: job_id is defined
       register: result_job_wait


Reviews:
user: login: sachin-apa
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-07T07:07:20Z
user: login: ABHISHEK-SINHA10
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-08T09:51:29Z
user: login: Saksham-Nautiyal
state: DISMISSED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T05:19:40Z
user: login: Saksham-Nautiyal
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T17:45:06Z
user: login: Kritika-Bhateja-03
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T09:41:05Z
user: login: trisha-dell
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T10:00:54Z

Review comments:
path: tests/integration/targets/prepare_idrac_lifecycle_controller_status/tasks/main.yaml
user: login: sachin-apa
body: warnings need to e fixed.
created_at: 2025-03-07T07:07:09Z
author_association: CONTRIBUTOR
path: tests/integration/targets/prepare_idrac_lifecycle_controller_status/tasks/main.yaml
user: login: ABHISHEK-SINHA10
body: Fixed
created_at: 2025-03-08T09:51:29Z
author_association: CONTRIBUTOR

PR comments:
user: login: ansible-collections-svc
created_at: 2025-03-07T06:40:01Z
body: Can one of the admins verify this patch?
author_association: COLLABORATOR
user: login: ABHISHEK-SINHA10
created_at: 2025-03-11T16:13:25Z
body: ![image](https://github.com/user-attachments/assets/58c89049-3f6e-4b09-a60a-36b05ebee466)

author_association: CONTRIBUTOR