From 5bdc99ef0f7897b7ea7e62b9db733e8cbf7adaa8 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Tue, 11 Apr 2017 15:35:45 +0800 Subject: Normalize system info variables and report Change-Id: I5627b4e2fa2287a1880433c7f25d9a2d1874cc26 Signed-off-by: Yujun Zhang --- tests/integration/compute.yaml | 2 +- tests/integration/reports/inxi-system-info | 36 ------------------------- tests/integration/reports/system-info | 36 +++++++++++++++++++++++++ tests/integration/tasks/inxi.yaml | 2 +- tests/integration/templates/inxi-system-info.j2 | 16 ----------- tests/integration/templates/system-info.j2 | 16 +++++++++++ 6 files changed, 54 insertions(+), 54 deletions(-) delete mode 100644 tests/integration/reports/inxi-system-info create mode 100644 tests/integration/reports/system-info delete mode 100644 tests/integration/templates/inxi-system-info.j2 create mode 100644 tests/integration/templates/system-info.j2 diff --git a/tests/integration/compute.yaml b/tests/integration/compute.yaml index cf9e6599..62f8b5db 100644 --- a/tests/integration/compute.yaml +++ b/tests/integration/compute.yaml @@ -78,6 +78,6 @@ - hosts: local tasks: - name: create system information report - local_action: template src=templates/inxi-system-info.j2 dest=reports/inxi-system-info + local_action: template src=templates/system-info.j2 dest=reports/system-info delegate_to: localhost # TODO(yujunz) push test result to testapi diff --git a/tests/integration/reports/inxi-system-info b/tests/integration/reports/inxi-system-info deleted file mode 100644 index 371243e2..00000000 --- a/tests/integration/reports/inxi-system-info +++ /dev/null @@ -1,36 +0,0 @@ -System Information from inxi -============================ - -node-26 ------------------------------ - -CPU Brand.................2 Deca core Intel Xeon E5-2650 v3s (-HT-MCP-SMP-) speed/max: 1200/3000 MHz -Disk............................................................................1200.3GB (0.8% used) -Host Name.........................................................................node-26.zte.com.cn -Kernel..............................................................4.4.0-66-generic x86_64 (64 bit) -Memory.............................................................................3836.1/128524.1MB -Operating System.................................................................Ubuntu 16.04 xenial -Product......................................................................................EC600G3 - -node-28 ------------------------------ - -CPU Brand.................2 Deca core Intel Xeon E5-2650 v3s (-HT-MCP-SMP-) speed/max: 1200/3000 MHz -Disk............................................................................1200.3GB (0.8% used) -Host Name.........................................................................node-28.zte.com.cn -Kernel..............................................................4.4.0-66-generic x86_64 (64 bit) -Memory.............................................................................3826.6/128524.1MB -Operating System.................................................................Ubuntu 16.04 xenial -Product......................................................................................EC600G3 - -node-27 ------------------------------ - -CPU Brand.................2 Deca core Intel Xeon E5-2650 v3s (-HT-MCP-SMP-) speed/max: 1200/3000 MHz -Disk............................................................................1200.3GB (0.8% used) -Host Name.........................................................................node-27.zte.com.cn -Kernel..............................................................4.4.0-66-generic x86_64 (64 bit) -Memory.............................................................................3922.4/128524.1MB -Operating System.................................................................Ubuntu 16.04 xenial -Product......................................................................................EC600G3 - diff --git a/tests/integration/reports/system-info b/tests/integration/reports/system-info new file mode 100644 index 00000000..371243e2 --- /dev/null +++ b/tests/integration/reports/system-info @@ -0,0 +1,36 @@ +System Information from inxi +============================ + +node-26 +----------------------------- + +CPU Brand.................2 Deca core Intel Xeon E5-2650 v3s (-HT-MCP-SMP-) speed/max: 1200/3000 MHz +Disk............................................................................1200.3GB (0.8% used) +Host Name.........................................................................node-26.zte.com.cn +Kernel..............................................................4.4.0-66-generic x86_64 (64 bit) +Memory.............................................................................3836.1/128524.1MB +Operating System.................................................................Ubuntu 16.04 xenial +Product......................................................................................EC600G3 + +node-28 +----------------------------- + +CPU Brand.................2 Deca core Intel Xeon E5-2650 v3s (-HT-MCP-SMP-) speed/max: 1200/3000 MHz +Disk............................................................................1200.3GB (0.8% used) +Host Name.........................................................................node-28.zte.com.cn +Kernel..............................................................4.4.0-66-generic x86_64 (64 bit) +Memory.............................................................................3826.6/128524.1MB +Operating System.................................................................Ubuntu 16.04 xenial +Product......................................................................................EC600G3 + +node-27 +----------------------------- + +CPU Brand.................2 Deca core Intel Xeon E5-2650 v3s (-HT-MCP-SMP-) speed/max: 1200/3000 MHz +Disk............................................................................1200.3GB (0.8% used) +Host Name.........................................................................node-27.zte.com.cn +Kernel..............................................................4.4.0-66-generic x86_64 (64 bit) +Memory.............................................................................3922.4/128524.1MB +Operating System.................................................................Ubuntu 16.04 xenial +Product......................................................................................EC600G3 + diff --git a/tests/integration/tasks/inxi.yaml b/tests/integration/tasks/inxi.yaml index a356040a..6c2db6a4 100644 --- a/tests/integration/tasks/inxi.yaml +++ b/tests/integration/tasks/inxi.yaml @@ -40,4 +40,4 @@ - '.+\sKernel:\s+(?P.+)\sConsole' - '.+\s+HDD Total Size:\s+(?P.+)\s' - '.+\sproduct:\s+(?P.+)\sv' - register: inxi_info + register: system_info diff --git a/tests/integration/templates/inxi-system-info.j2 b/tests/integration/templates/inxi-system-info.j2 deleted file mode 100644 index 35c8661f..00000000 --- a/tests/integration/templates/inxi-system-info.j2 +++ /dev/null @@ -1,16 +0,0 @@ -System Information from inxi -============================ - -{% for host in groups['compute'] %} -{{ hostvars[host].ansible_hostname }} ------------------------------ - -{{ ('CPU Brand', hostvars[host].inxi_info.cpu[0])|justify }} -{{ ('Disk', hostvars[host].inxi_info.disk[0])|justify }} -{{ ('Host Name', hostvars[host].inxi_info.hostname[0])|justify }} -{{ ('Kernel', hostvars[host].inxi_info.kernel[0])|justify }} -{{ ('Memory', hostvars[host].inxi_info.memory[0])|justify }} -{{ ('Operating System', hostvars[host].inxi_info.os[0])|justify }} -{{ ('Product', hostvars[host].inxi_info.product[0])|justify }} - -{% endfor %} diff --git a/tests/integration/templates/system-info.j2 b/tests/integration/templates/system-info.j2 new file mode 100644 index 00000000..305a2af2 --- /dev/null +++ b/tests/integration/templates/system-info.j2 @@ -0,0 +1,16 @@ +System Information from inxi +============================ + +{% for host in groups['compute'] %} +{{ hostvars[host].ansible_hostname }} +----------------------------- + +{{ ('CPU Brand', hostvars[host].system_info.cpu[0])|justify }} +{{ ('Disk', hostvars[host].system_info.disk[0])|justify }} +{{ ('Host Name', hostvars[host].system_info.hostname[0])|justify }} +{{ ('Kernel', hostvars[host].system_info.kernel[0])|justify }} +{{ ('Memory', hostvars[host].system_info.memory[0])|justify }} +{{ ('Operating System', hostvars[host].system_info.os[0])|justify }} +{{ ('Product', hostvars[host].system_info.product[0])|justify }} + +{% endfor %} -- cgit 1.2.3-korg