From 99c554569378d487b111ae01494f040686f0084a Mon Sep 17 00:00:00 2001 From: Li Zhang Date: Thu, 20 Dec 2012 10:31:05 +0800 Subject: [PATCH] Add sysinfo data and enable virSysinfoRead test case for POWER This patch is to enable virSysinfoRead test case for POWER, and provide sysinfo data on POWER. Signed-off-by: Li Zhang Reviewed-by: Viktor Mihajlovski --- 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 0000000000..bf4433ce33 --- /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 0000000000..32407e070d --- /dev/null +++ b/tests/sysinfodata/ppcsysinfo.expect @@ -0,0 +1,87 @@ + + + PowerNV 8246-L2C + 8246-L2C + PowerNV + + + 0 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 4 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 8 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 12 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 16 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 20 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 24 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 28 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 32 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 36 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 40 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 44 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 48 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 52 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 56 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + + 60 + POWER7 (raw), altivec supported + 2.3 (pvr 003f 0203) + + diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index 79ee1286a2..353bc7659c 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) { -- GitLab