- 26 10月, 2018 1 次提交
-
-
由 Marc-André Lureau 提交于
Using g_spawn_async_with_pipes() is more complicated than running the sync version. The async version returns a file descriptor for stdout, which may not be fully read. Sometime "--tpm2" will failed to be read, and will cause the related test to be silently skipped. Use g_spawn_sync() instead, simplifying the code and fixing the race. Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
-
- 16 8月, 2018 2 次提交
-
-
由 Markus Armbruster 提交于
Commit b21373d0 copied wait_command() from tests/migration-test.c to tests/tpm-util.c. Replace both copies by new libqtest helper qtest_qmp_receive_success(). Also use it to simplify qtest_qmp_device_del(). Bonus: gets rid of a non-literal format string. A step towards compile-time format string checking without triggering -Wformat-nonliteral. Cc: Thomas Huth <thuth@redhat.com> Cc: Juan Quintela <quintela@redhat.com> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Cc: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Reviewed-by: NJuan Quintela <quintela@redhat.com> Reviewed-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: NEric Blake <eblake@redhat.com> Message-Id: <20180806065344.7103-17-armbru@redhat.com>
-
由 Markus Armbruster 提交于
When you build QMP input manually like this cmd = g_strdup_printf("{ 'execute': 'migrate'," "'arguments': { 'uri': '%s' } }", uri); rsp = qmp(cmd); g_free(cmd); you're responsible for escaping the interpolated values for JSON. Not done here, and therefore works only for sufficiently nice @uri. For instance, if @uri contained a single "'", qobject_from_vjsonf_nofail() would abort. A sufficiently nasty @uri could even inject unwanted members into the arguments object. Leaving interpolation into JSON to qmp() is more robust: rsp = qmp("{ 'execute': 'migrate', 'arguments': { 'uri': %s } }", uri); It's also more concise. Clean up the simple cases where we interpolate exactly a JSON value. Bonus: gets rid of non-literal format strings. A step towards compile-time format string checking without triggering -Wformat-nonliteral. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: NEric Blake <eblake@redhat.com> Message-Id: <20180806065344.7103-13-armbru@redhat.com>
-
- 07 6月, 2018 3 次提交
-
-
由 Stefan Berger 提交于
Add a test case for testing swtpm migration with the TPM TIS interface. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
-
由 Stefan Berger 提交于
Pass the TPM interface model, such as 'tpm-crb', through to the functions that create the command line for QEMU. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
-
由 Stefan Berger 提交于
Move code we can reuse from tpm-crb-swtpm-test.c into tpm-util.c and prefix functions with 'tpm_util_'. Remove some unnecessary #include's. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
-
- 26 5月, 2018 1 次提交
-
-
由 Stefan Berger 提交于
Add a test program for testing the CRB with the external swtpm. The 1st test case extends a PCR and reads back the value and compares it against an expected return packet. The 2nd test case repeats the 1st test case and then migrates the external swtpm's state along with the VM state to a destination QEMU and swtpm and checks that the PCR has the expected value now. The test cases require 'swtpm' to be installed on the system and in the PATH and 'swtpm' must support the --tpm2 option. If this is not the case, the test will be skipped. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
-