From 149b6c9fceff4ca60e671caf2ae3266b9d9b2b65 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Mon, 5 Feb 2018 18:24:42 +0000 Subject: [PATCH 1/3] [reboot test] call sudo reboot to reboot dut - Using reboot allow the dut to reboot with platform specific reboot tools. - Ansible behaves differently with "become: yes + reboot" and "sudo reboot" It appears that only the later could reboot the DUT. This behavior might have caused by sonic intercepts reboot with a script. --- ansible/roles/test/tasks/common_tasks/reboot_sonic.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ansible/roles/test/tasks/common_tasks/reboot_sonic.yml b/ansible/roles/test/tasks/common_tasks/reboot_sonic.yml index 21ec0f8cacf..8013ad36d76 100644 --- a/ansible/roles/test/tasks/common_tasks/reboot_sonic.yml +++ b/ansible/roles/test/tasks/common_tasks/reboot_sonic.yml @@ -1,6 +1,5 @@ - name: reboot - become: true - shell: shutdown -r now "Warning! System is being rebooted remotely by reboot_sonic.yml" + shell: sudo reboot async: 1 poll: 0 ignore_errors: true From 5b31f271cbd08810448347d28e410dc050e36411 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Mon, 5 Feb 2018 18:42:20 +0000 Subject: [PATCH 2/3] [reboot test] improvoe test description --- ansible/roles/test/tasks/common_tasks/reboot_sonic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/test/tasks/common_tasks/reboot_sonic.yml b/ansible/roles/test/tasks/common_tasks/reboot_sonic.yml index 8013ad36d76..12db3db4643 100644 --- a/ansible/roles/test/tasks/common_tasks/reboot_sonic.yml +++ b/ansible/roles/test/tasks/common_tasks/reboot_sonic.yml @@ -1,4 +1,4 @@ -- name: reboot +- name: rebooting {{ ansible_host }} ... shell: sudo reboot async: 1 poll: 0 From 24c7c85c82dda39c9cfa8bfd1445fa39ca3932de Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Mon, 5 Feb 2018 18:52:22 +0000 Subject: [PATCH 3/3] [reboot test] improve test message, take 2 --- ansible/roles/test/tasks/common_tasks/reboot_sonic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/test/tasks/common_tasks/reboot_sonic.yml b/ansible/roles/test/tasks/common_tasks/reboot_sonic.yml index 12db3db4643..56487f788ab 100644 --- a/ansible/roles/test/tasks/common_tasks/reboot_sonic.yml +++ b/ansible/roles/test/tasks/common_tasks/reboot_sonic.yml @@ -1,4 +1,4 @@ -- name: rebooting {{ ansible_host }} ... +- name: "rebooting {{ inventory_hostname }} : {{ ansible_host }} ..." shell: sudo reboot async: 1 poll: 0