From: Fabiano Rosas <farosas@suse.de>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, Juan Quintela <quintela@redhat.com>,
Peter Xu <peterx@redhat.com>,
Steve Sistare <steven.sistare@oracle.com>,
Nikolay Borisov <nborisov@suse.com>,
Leonardo Bras <leobras@redhat.com>,
Thomas Huth <thuth@redhat.com>,
Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 6/6] tests/qtest: migration-test: Add tests for file-based migration
Date: Tue, 27 Jun 2023 09:54:53 -0300 [thread overview]
Message-ID: <875y799iaq.fsf@suse.de> (raw)
In-Reply-To: <ZJqmvBzeZox2nrXs@redhat.com>
Daniel P. Berrangé <berrange@redhat.com> writes:
> On Mon, Jun 26, 2023 at 03:22:10PM -0300, Fabiano Rosas wrote:
>> From: Nikolay Borisov <nborisov@suse.com>
>>
>> Add basic tests for file-based migration.
>>
>> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>> ---
>> tests/qtest/migration-test.c | 66 ++++++++++++++++++++++++++++++++++++
>> 1 file changed, 66 insertions(+)
>>
>> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
>> index acb778a8cd..5a77257a53 100644
>> --- a/tests/qtest/migration-test.c
>> +++ b/tests/qtest/migration-test.c
>> @@ -763,6 +763,7 @@ static void test_migrate_end(QTestState *from, QTestState *to, bool test_dest)
>> cleanup("migsocket");
>> cleanup("src_serial");
>> cleanup("dest_serial");
>> + cleanup("migfile");
>> }
>>
>> #ifdef CONFIG_GNUTLS
>> @@ -1460,11 +1461,28 @@ static void test_precopy_common(MigrateCommon *args)
>> */
>> wait_for_migration_complete(from);
>>
>> + /*
>> + * For file based migration the target must begin its
>> + * migration after the source has finished.
>> + */
>> + if (strstr(connect_uri, "file:")) {
>> + migrate_incoming_qmp(to, connect_uri, "{}");
>> + }
>> +
>> if (!got_src_stop) {
>> qtest_qmp_eventwait(from, "STOP");
>> }
>> } else {
>> wait_for_migration_complete(from);
>> +
>> + /*
>> + * For file based migration the target must begin its
>> + * migration after the source has finished.
>> + */
>> + if (strstr(connect_uri, "file:")) {
>> + migrate_incoming_qmp(to, connect_uri, "{}");
>> + }
>> +
>> /*
>> * Must wait for dst to finish reading all incoming
>> * data on the socket before issuing 'cont' otherwise
>> @@ -1682,6 +1700,46 @@ static void test_precopy_unix_compress_nowait(void)
>> test_precopy_common(&args);
>> }
>>
>> +static void test_precopy_file(void)
>> +{
>> + g_autofree char *uri = g_strdup_printf("file:%s/migfile", tmpfs);
>
> There's no unlink(), so I presume you're relying on the entire 'tmpfs'
> being recursively deleted ?
>
The first hunk adds a call to cleanup(), which has the unlink().
>> + MigrateCommon args = {
>> + .connect_uri = uri,
>> + .listen_uri = "defer",
>> + };
>> +
>> + test_precopy_common(&args);
>> +}
>> +
>> +static void test_precopy_file_offset(void)
>> +{
>> + g_autofree char *uri = g_strdup_printf("file:%s/migfile,offset=0x1000",
>> + tmpfs);
>> + MigrateCommon args = {
>> + .connect_uri = uri,
>> + .listen_uri = "defer",
>> + };
>> +
>> + test_precopy_common(&args);
>
> There ought to be something here that values 0->0x1000 bytes are
> all zeroes in the file.
>
Good idea, thanks.
next prev parent reply other threads:[~2023-06-27 12:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 18:22 [PATCH 0/6] migration: Test the new "file:" migration Fabiano Rosas
2023-06-26 18:22 ` [PATCH 1/6] migration: Set migration status early in incoming side Fabiano Rosas
2023-06-27 9:11 ` Juan Quintela
2023-06-27 12:36 ` Fabiano Rosas
2023-06-26 18:22 ` [PATCH 2/6] tests/qtest: migration: Expose migrate_set_capability Fabiano Rosas
2023-06-27 9:12 ` Juan Quintela
2023-06-26 18:22 ` [PATCH 3/6] tests/qtest: migration: Add migrate_incoming_qmp helper Fabiano Rosas
2023-06-26 18:22 ` [PATCH 4/6] tests/qtest: migration: Use migrate_incoming_qmp where appropriate Fabiano Rosas
2023-06-27 9:13 ` Juan Quintela
2023-06-26 18:22 ` [PATCH 5/6] tests/qtest: migration: Add support for negative testing of qmp_migrate Fabiano Rosas
2023-06-26 18:22 ` [PATCH 6/6] tests/qtest: migration-test: Add tests for file-based migration Fabiano Rosas
2023-06-27 9:07 ` Daniel P. Berrangé
2023-06-27 12:54 ` Fabiano Rosas [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-06-28 16:55 [PATCH 0/6] migration: Test the new "file:" migration Fabiano Rosas
2023-06-28 16:55 ` [PATCH 6/6] tests/qtest: migration-test: Add tests for file-based migration Fabiano Rosas
2023-06-29 21:36 ` Peter Xu
2023-06-30 15:05 ` Fabiano Rosas
2023-06-30 15:19 ` Steven Sistare
2023-06-30 16:25 ` Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875y799iaq.fsf@suse.de \
--to=farosas@suse.de \
--cc=berrange@redhat.com \
--cc=leobras@redhat.com \
--cc=lvivier@redhat.com \
--cc=nborisov@suse.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=steven.sistare@oracle.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.