From: Li Zhang <zhlcindy@xxxxxxxxxxxxxxxxxx> This patch is to enable virSysinfoRead test case for POWER, and provide sysinfo data on POWER. Signed-off-by: Li Zhang <zhlcindy@xxxxxxxxxxxxxxxxxx> Reviewed-by: Viktor Mihajlovski <mihajlov@xxxxxxxxxxxxxxxxxx> --- tests/sysinfodata/ppccpuinfo.data | 85 ++++++++++++++++++++++++++++++++++ tests/sysinfodata/ppcsysinfo.expect | 87 +++++++++++++++++++++++++++++++++++ tests/sysinfotest.c | 25 ---------- 3 files changed, 172 insertions(+), 25 deletions(-) create mode 100644 tests/sysinfodata/ppccpuinfo.data create mode 100644 tests/sysinfodata/ppcsysinfo.expect diff --git a/tests/sysinfodata/ppccpuinfo.data b/tests/sysinfodata/ppccpuinfo.data new file mode 100644 index 0000000..bf4433c --- /dev/null +++ b/tests/sysinfodata/ppccpuinfo.data @@ -0,0 +1,85 @@ +processor : 0 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 4 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 8 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 12 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 16 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 20 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 24 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 28 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 32 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 36 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 40 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 44 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 48 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 52 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 56 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 60 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +timebase : 512000000 +platform : PowerNV +model : 8246-L2C +machine : PowerNV 8246-L2C +firmware : OPAL v2 diff --git a/tests/sysinfodata/ppcsysinfo.expect b/tests/sysinfodata/ppcsysinfo.expect new file mode 100644 index 0000000..32407e0 --- /dev/null +++ b/tests/sysinfodata/ppcsysinfo.expect @@ -0,0 +1,87 @@ +<sysinfo type='smbios'> + <system> + <entry name='version'>PowerNV 8246-L2C</entry> + <entry name='serial'>8246-L2C</entry> + <entry name='family'>PowerNV</entry> + </system> + <processor> + <entry name='socket_destination'>0</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>4</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>8</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>12</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>16</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>20</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>24</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>28</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>32</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>36</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>40</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>44</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>48</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>52</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>56</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> + <processor> + <entry name='socket_destination'>60</entry> + <entry name='type'>POWER7 (raw), altivec supported</entry> + <entry name='version'>2.3 (pvr 003f 0203)</entry> + </processor> +</sysinfo> diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index 79ee128..353bc76 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -50,27 +50,6 @@ struct testSysinfoData { char *expected; /* (required) file containing output of virSysinfoFormat */ }; -# if defined(__powerpc__) || defined(__powerpc64__) -/* TODO ppc: remove the if defined() branch - to enable the real test run after providing test data, see below. - */ -static int -testSysinfo(const void *data ATTRIBUTE_UNUSED) -{ - return EXIT_AM_SKIP; -} - -static int -sysinfotest_run(const char *test ATTRIBUTE_UNUSED, - const char *decoder ATTRIBUTE_UNUSED, - const char *sysinfo ATTRIBUTE_UNUSED, - const char *cpuinfo ATTRIBUTE_UNUSED, - const char *expected ATTRIBUTE_UNUSED) -{ - return testSysinfo(NULL); -} -# else - static int testSysinfo(const void *data) { @@ -143,7 +122,6 @@ error: VIR_FREE(testdata.expected); return ret; } -# endif /* defined(__powerpc__) ... */ # if defined(__s390__) || defined(__s390x__) static int @@ -158,9 +136,6 @@ test_s390(void) VIRT_TEST_MAIN(test_s390) # elif defined(__powerpc__) || defined(__powerpc64__) -/* TODO for PPC owner: provide test data - and enable the real sysinfotest_run above -*/ static int test_ppc(void) { -- 1.7.10.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list