tests: qemucaps: Make fake 'microcodeVersion' depend on filename instead of length

To avoid changes to the filled in microcode in case we change the caps
replies file for any reason make the number depend on the filename.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Peter Krempa 2019-01-28 10:22:00 +01:00
parent f15789ecac
commit aedd20386d
33 changed files with 45 additions and 36 deletions

View File

@ -98,7 +98,7 @@
<flag name='mch'/> <flag name='mch'/>
<version>1005003</version> <version>1005003</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>48498</microcodeVersion> <microcodeVersion>43100763</microcodeVersion>
<package></package> <package></package>
<arch>x86_64</arch> <arch>x86_64</arch>
<cpu type='kvm' name='Opteron_G5'/> <cpu type='kvm' name='Opteron_G5'/>

View File

@ -103,7 +103,7 @@
<flag name='mch'/> <flag name='mch'/>
<version>1006000</version> <version>1006000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>46667</microcodeVersion> <microcodeVersion>43100761</microcodeVersion>
<package></package> <package></package>
<arch>x86_64</arch> <arch>x86_64</arch>
<cpu type='kvm' name='Opteron_G5'/> <cpu type='kvm' name='Opteron_G5'/>

View File

@ -105,7 +105,7 @@
<flag name='mch'/> <flag name='mch'/>
<version>1007000</version> <version>1007000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>52111</microcodeVersion> <microcodeVersion>43100762</microcodeVersion>
<package></package> <package></package>
<arch>x86_64</arch> <arch>x86_64</arch>
<cpu type='kvm' name='Opteron_G5'/> <cpu type='kvm' name='Opteron_G5'/>

View File

@ -121,7 +121,7 @@
<flag name='mch'/> <flag name='mch'/>
<version>2001001</version> <version>2001001</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>60857</microcodeVersion> <microcodeVersion>43100758</microcodeVersion>
<package></package> <package></package>
<arch>x86_64</arch> <arch>x86_64</arch>
<cpu type='kvm' name='Opteron_G5'/> <cpu type='kvm' name='Opteron_G5'/>

View File

@ -154,7 +154,7 @@
<flag name='iothread.poll-max-ns'/> <flag name='iothread.poll-max-ns'/>
<version>2010000</version> <version>2010000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>305067</microcodeVersion> <microcodeVersion>61700805</microcodeVersion>
<package> (v2.10.0)</package> <package> (v2.10.0)</package>
<arch>aarch64</arch> <arch>aarch64</arch>
<cpu type='kvm' name='pxa262'/> <cpu type='kvm' name='pxa262'/>

View File

@ -153,7 +153,7 @@
<flag name='iothread.poll-max-ns'/> <flag name='iothread.poll-max-ns'/>
<version>2010000</version> <version>2010000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>384412</microcodeVersion> <microcodeVersion>42900805</microcodeVersion>
<package> (v2.10.0)</package> <package> (v2.10.0)</package>
<arch>ppc64</arch> <arch>ppc64</arch>
<cpu type='kvm' name='default'/> <cpu type='kvm' name='default'/>

View File

@ -117,7 +117,7 @@
<flag name='iothread.poll-max-ns'/> <flag name='iothread.poll-max-ns'/>
<version>2010000</version> <version>2010000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>306247</microcodeVersion> <microcodeVersion>39100805</microcodeVersion>
<package></package> <package></package>
<arch>s390x</arch> <arch>s390x</arch>
<hostCPU type='kvm' model='z14-base' migratability='no'> <hostCPU type='kvm' model='z14-base' migratability='no'>

View File

@ -195,7 +195,7 @@
<flag name='iothread.poll-max-ns'/> <flag name='iothread.poll-max-ns'/>
<version>2010000</version> <version>2010000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>364616</microcodeVersion> <microcodeVersion>43100805</microcodeVersion>
<package> (v2.10.0)</package> <package> (v2.10.0)</package>
<arch>x86_64</arch> <arch>x86_64</arch>
<hostCPU type='kvm' model='base' migratability='yes'> <hostCPU type='kvm' model='base' migratability='yes'>

View File

@ -124,7 +124,7 @@
<flag name='iothread.poll-max-ns'/> <flag name='iothread.poll-max-ns'/>
<version>2011000</version> <version>2011000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>345099</microcodeVersion> <microcodeVersion>39100806</microcodeVersion>
<package></package> <package></package>
<arch>s390x</arch> <arch>s390x</arch>
<hostCPU type='kvm' model='z14-base' migratability='no'> <hostCPU type='kvm' model='z14-base' migratability='no'>

View File

@ -201,7 +201,7 @@
<flag name='iothread.poll-max-ns'/> <flag name='iothread.poll-max-ns'/>
<version>2011000</version> <version>2011000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>369105</microcodeVersion> <microcodeVersion>43100806</microcodeVersion>
<package> (v2.11.0)</package> <package> (v2.11.0)</package>
<arch>x86_64</arch> <arch>x86_64</arch>
<hostCPU type='kvm' model='base' migratability='yes'> <hostCPU type='kvm' model='base' migratability='yes'>

View File

@ -168,7 +168,7 @@
<flag name='memory-backend-file.align'/> <flag name='memory-backend-file.align'/>
<version>2011090</version> <version>2011090</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>345725</microcodeVersion> <microcodeVersion>61700807</microcodeVersion>
<package>v2.12.0-rc0</package> <package>v2.12.0-rc0</package>
<arch>aarch64</arch> <arch>aarch64</arch>
<cpu type='kvm' name='pxa262'/> <cpu type='kvm' name='pxa262'/>

View File

@ -166,7 +166,7 @@
<flag name='memory-backend-file.align'/> <flag name='memory-backend-file.align'/>
<version>2011090</version> <version>2011090</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>426509</microcodeVersion> <microcodeVersion>42900807</microcodeVersion>
<package>v2.12.0-rc0</package> <package>v2.12.0-rc0</package>
<arch>ppc64</arch> <arch>ppc64</arch>
<cpu type='kvm' name='default'/> <cpu type='kvm' name='default'/>

View File

@ -135,7 +135,7 @@
<flag name='memory-backend-file.align'/> <flag name='memory-backend-file.align'/>
<version>2012000</version> <version>2012000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>375102</microcodeVersion> <microcodeVersion>39100807</microcodeVersion>
<package></package> <package></package>
<arch>s390x</arch> <arch>s390x</arch>
<hostCPU type='kvm' model='z14-base' migratability='no'> <hostCPU type='kvm' model='z14-base' migratability='no'>

View File

@ -209,7 +209,7 @@
<flag name='memory-backend-file.align'/> <flag name='memory-backend-file.align'/>
<version>2011090</version> <version>2011090</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>414601</microcodeVersion> <microcodeVersion>43100807</microcodeVersion>
<package>v2.12.0-rc0</package> <package>v2.12.0-rc0</package>
<arch>x86_64</arch> <arch>x86_64</arch>
<hostCPU type='kvm' model='base' migratability='yes'> <hostCPU type='kvm' model='base' migratability='yes'>

View File

@ -147,7 +147,7 @@
<flag name='mch'/> <flag name='mch'/>
<version>2004000</version> <version>2004000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>77219</microcodeVersion> <microcodeVersion>43100760</microcodeVersion>
<package></package> <package></package>
<arch>x86_64</arch> <arch>x86_64</arch>
<cpu type='kvm' name='Opteron_G5'/> <cpu type='kvm' name='Opteron_G5'/>

View File

@ -153,7 +153,7 @@
<flag name='mch'/> <flag name='mch'/>
<version>2005000</version> <version>2005000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>218187</microcodeVersion> <microcodeVersion>43100761</microcodeVersion>
<package></package> <package></package>
<arch>x86_64</arch> <arch>x86_64</arch>
<cpu type='kvm' name='Opteron_G5'/> <cpu type='kvm' name='Opteron_G5'/>

View File

@ -137,7 +137,7 @@
<flag name='hda-output'/> <flag name='hda-output'/>
<version>2006000</version> <version>2006000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>229858</microcodeVersion> <microcodeVersion>61700762</microcodeVersion>
<package></package> <package></package>
<arch>aarch64</arch> <arch>aarch64</arch>
<cpu type='kvm' name='pxa262'/> <cpu type='kvm' name='pxa262'/>

View File

@ -132,7 +132,7 @@
<flag name='hda-output'/> <flag name='hda-output'/>
<version>2006000</version> <version>2006000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>264684</microcodeVersion> <microcodeVersion>42900762</microcodeVersion>
<package></package> <package></package>
<arch>ppc64</arch> <arch>ppc64</arch>
<cpu type='kvm' name='default'/> <cpu type='kvm' name='default'/>

View File

@ -165,7 +165,7 @@
<flag name='mch'/> <flag name='mch'/>
<version>2006000</version> <version>2006000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>229221</microcodeVersion> <microcodeVersion>43100762</microcodeVersion>
<package></package> <package></package>
<arch>x86_64</arch> <arch>x86_64</arch>
<cpu type='kvm' name='Opteron_G5'/> <cpu type='kvm' name='Opteron_G5'/>

View File

@ -103,7 +103,7 @@
<flag name='zpci'/> <flag name='zpci'/>
<version>2007000</version> <version>2007000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>219140</microcodeVersion> <microcodeVersion>39100763</microcodeVersion>
<package></package> <package></package>
<arch>s390x</arch> <arch>s390x</arch>
<cpu type='kvm' name='host'/> <cpu type='kvm' name='host'/>

View File

@ -170,7 +170,7 @@
<flag name='mch'/> <flag name='mch'/>
<version>2007000</version> <version>2007000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>240727</microcodeVersion> <microcodeVersion>43100763</microcodeVersion>
<package> (v2.7.0)</package> <package> (v2.7.0)</package>
<arch>x86_64</arch> <arch>x86_64</arch>
<cpu type='kvm' name='Opteron_G5'/> <cpu type='kvm' name='Opteron_G5'/>

View File

@ -106,7 +106,7 @@
<flag name='zpci'/> <flag name='zpci'/>
<version>2007093</version> <version>2007093</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>244554</microcodeVersion> <microcodeVersion>39100764</microcodeVersion>
<package></package> <package></package>
<arch>s390x</arch> <arch>s390x</arch>
<hostCPU type='kvm' model='zEC12.2-base' migratability='no'> <hostCPU type='kvm' model='zEC12.2-base' migratability='no'>

View File

@ -173,7 +173,7 @@
<flag name='mch'/> <flag name='mch'/>
<version>2008000</version> <version>2008000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>257382</microcodeVersion> <microcodeVersion>43100764</microcodeVersion>
<package> (v2.8.0)</package> <package> (v2.8.0)</package>
<arch>x86_64</arch> <arch>x86_64</arch>
<cpu type='kvm' name='host' usable='yes'/> <cpu type='kvm' name='host' usable='yes'/>

View File

@ -145,7 +145,7 @@
<flag name='iothread.poll-max-ns'/> <flag name='iothread.poll-max-ns'/>
<version>2009000</version> <version>2009000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>349056</microcodeVersion> <microcodeVersion>42900765</microcodeVersion>
<package> (v2.9.0)</package> <package> (v2.9.0)</package>
<arch>ppc64</arch> <arch>ppc64</arch>
<cpu type='kvm' name='default'/> <cpu type='kvm' name='default'/>

View File

@ -111,7 +111,7 @@
<flag name='iothread.poll-max-ns'/> <flag name='iothread.poll-max-ns'/>
<version>2009000</version> <version>2009000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>267973</microcodeVersion> <microcodeVersion>39100765</microcodeVersion>
<package></package> <package></package>
<arch>s390x</arch> <arch>s390x</arch>
<hostCPU type='kvm' model='z13.2-base' migratability='no'> <hostCPU type='kvm' model='z13.2-base' migratability='no'>

View File

@ -189,7 +189,7 @@
<flag name='iothread.poll-max-ns'/> <flag name='iothread.poll-max-ns'/>
<version>2009000</version> <version>2009000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>340605</microcodeVersion> <microcodeVersion>43100765</microcodeVersion>
<package> (v2.9.0)</package> <package> (v2.9.0)</package>
<arch>x86_64</arch> <arch>x86_64</arch>
<hostCPU type='kvm' model='base' migratability='yes'> <hostCPU type='kvm' model='base' migratability='yes'>

View File

@ -166,7 +166,7 @@
<flag name='memory-backend-file.align'/> <flag name='memory-backend-file.align'/>
<version>2012050</version> <version>2012050</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>444946</microcodeVersion> <microcodeVersion>42900757</microcodeVersion>
<package>v2.12.0-1689-g518d23a</package> <package>v2.12.0-1689-g518d23a</package>
<arch>ppc64</arch> <arch>ppc64</arch>
<cpu type='kvm' name='default'/> <cpu type='kvm' name='default'/>

View File

@ -137,7 +137,7 @@
<flag name='memory-backend-file.align'/> <flag name='memory-backend-file.align'/>
<version>3000000</version> <version>3000000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>388416</microcodeVersion> <microcodeVersion>39100757</microcodeVersion>
<package></package> <package></package>
<arch>s390x</arch> <arch>s390x</arch>
<hostCPU type='kvm' model='z14-base' migratability='no'> <hostCPU type='kvm' model='z14-base' migratability='no'>

View File

@ -212,7 +212,7 @@
<flag name='nvdimm.unarmed'/> <flag name='nvdimm.unarmed'/>
<version>3000000</version> <version>3000000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>426554</microcodeVersion> <microcodeVersion>43100757</microcodeVersion>
<package>v3.0.0</package> <package>v3.0.0</package>
<arch>x86_64</arch> <arch>x86_64</arch>
<hostCPU type='kvm' model='base' migratability='yes'> <hostCPU type='kvm' model='base' migratability='yes'>

View File

@ -170,7 +170,7 @@
<flag name='memory-backend-file.pmem'/> <flag name='memory-backend-file.pmem'/>
<version>3000091</version> <version>3000091</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>437731</microcodeVersion> <microcodeVersion>42900758</microcodeVersion>
<package>v3.1.0-rc1-74-g3c035a41dc</package> <package>v3.1.0-rc1-74-g3c035a41dc</package>
<arch>ppc64</arch> <arch>ppc64</arch>
<cpu type='kvm' name='default'/> <cpu type='kvm' name='default'/>

View File

@ -214,7 +214,7 @@
<flag name='nvdimm.unarmed'/> <flag name='nvdimm.unarmed'/>
<version>3000092</version> <version>3000092</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>440976</microcodeVersion> <microcodeVersion>43100758</microcodeVersion>
<package>v3.1.0-rc2-48-g039d4e3df0</package> <package>v3.1.0-rc2-48-g039d4e3df0</package>
<arch>x86_64</arch> <arch>x86_64</arch>
<hostCPU type='kvm' model='base' migratability='yes'> <hostCPU type='kvm' model='base' migratability='yes'>

View File

@ -214,7 +214,7 @@
<flag name='nvdimm.unarmed'/> <flag name='nvdimm.unarmed'/>
<version>3001050</version> <version>3001050</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>446361</microcodeVersion> <microcodeVersion>43100758</microcodeVersion>
<package>v3.1.0-759-g15bede5541</package> <package>v3.1.0-759-g15bede5541</package>
<arch>x86_64</arch> <arch>x86_64</arch>
<hostCPU type='kvm' model='base' migratability='yes'> <hostCPU type='kvm' model='base' migratability='yes'>

View File

@ -48,6 +48,8 @@ testQemuCaps(const void *opaque)
qemuMonitorTestPtr mon = NULL; qemuMonitorTestPtr mon = NULL;
virQEMUCapsPtr capsActual = NULL; virQEMUCapsPtr capsActual = NULL;
char *actual = NULL; char *actual = NULL;
unsigned int fakeMicrocodeVersion = 0;
const char *p;
if (virAsprintf(&repliesFile, "%s/qemucapabilitiesdata/%s.%s.replies", if (virAsprintf(&repliesFile, "%s/qemucapabilitiesdata/%s.%s.replies",
abs_srcdir, data->base, data->archName) < 0 || abs_srcdir, data->base, data->archName) < 0 ||
@ -69,10 +71,17 @@ testQemuCaps(const void *opaque)
qemuMonitorTestGetMonitor(mon)) < 0) qemuMonitorTestGetMonitor(mon)) < 0)
goto cleanup; goto cleanup;
/* Fill microcodeVersion with a "random" value which is the file /* calculate fake microcode version based on filename for a reproducible
* length to provide a reproducible number for testing. * number for testing which does not change with the contents */
*/ for (p = data->archName; *p; p++)
virQEMUCapsSetMicrocodeVersion(capsActual, virFileLength(repliesFile, -1)); fakeMicrocodeVersion += *p;
fakeMicrocodeVersion *= 100000;
for (p = data->base; *p; p++)
fakeMicrocodeVersion += *p;
virQEMUCapsSetMicrocodeVersion(capsActual, fakeMicrocodeVersion);
} }
if (!(actual = virQEMUCapsFormatCache(capsActual))) if (!(actual = virQEMUCapsFormatCache(capsActual)))