1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

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'/>
<version>1005003</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>48498</microcodeVersion>
<microcodeVersion>43100763</microcodeVersion>
<package></package>
<arch>x86_64</arch>
<cpu type='kvm' name='Opteron_G5'/>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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