qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Michael Labiuk <michael.labiuk@virtuozzo.com>, qemu-devel@nongnu.org
Cc: Laurent Vivier <lvivier@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	 "Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	den@virtuozzo.com, "Michael S. Tsirkin" <mst@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Subject: Re: [PATCH v5 4/9] tests/x86: Add 'q35' machine type to override-tests in hd-geo-test
Date: Tue, 11 Oct 2022 13:23:22 +0200	[thread overview]
Message-ID: <19e4252d-5efc-fb09-c714-ffda4a3b5203@redhat.com> (raw)
In-Reply-To: <20220929223547.1429580-5-michael.labiuk@virtuozzo.com>

On 30/09/2022 00.35, Michael Labiuk via wrote:
> Signed-off-by: Michael Labiuk <michael.labiuk@virtuozzo.com>
> ---
>   tests/qtest/hd-geo-test.c | 97 +++++++++++++++++++++++++++++++++++++++
>   1 file changed, 97 insertions(+)
> 
> diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c
> index 61f4c24b81..278464c379 100644
> --- a/tests/qtest/hd-geo-test.c
> +++ b/tests/qtest/hd-geo-test.c
> @@ -741,6 +741,27 @@ static void test_override_ide(void)
>       test_override(args, "pc", expected);
>   }
>   
> +static void test_override_sata(void)
> +{
> +    TestArgs *args = create_args();
> +    CHSResult expected[] = {
> +        {"/pci@i0cf8/pci8086,2922@1f,2/drive@0/disk@0", {10000, 120, 30} },
> +        {"/pci@i0cf8/pci8086,2922@1f,2/drive@1/disk@0", {9000, 120, 30} },
> +        {"/pci@i0cf8/pci8086,2922@1f,2/drive@2/disk@0", {0, 1, 1} },
> +        {"/pci@i0cf8/pci8086,2922@1f,2/drive@3/disk@0", {1, 0, 0} },
> +        {NULL, {0, 0, 0} }
> +    };
> +    add_drive_with_mbr(args, empty_mbr, 1);
> +    add_drive_with_mbr(args, empty_mbr, 1);
> +    add_drive_with_mbr(args, empty_mbr, 1);
> +    add_drive_with_mbr(args, empty_mbr, 1);
> +    add_ide_disk(args, 0, 0, 0, 10000, 120, 30);
> +    add_ide_disk(args, 1, 1, 0, 9000, 120, 30);
> +    add_ide_disk(args, 2, 2, 0, 0, 1, 1);
> +    add_ide_disk(args, 3, 3, 0, 1, 0, 0);
> +    test_override(args, "q35", expected);
> +}
> +
>   static void test_override_scsi(void)
>   {
>       TestArgs *args = create_args();
> @@ -763,6 +784,42 @@ static void test_override_scsi(void)
>       test_override(args, "pc", expected);
>   }
>   
> +static void setup_pci_bridge(TestArgs *args, const char *id, const char *rootid)
> +{
> +
> +    char *root, *br;
> +    root = g_strdup_printf("-device pcie-root-port,id=%s", rootid);
> +    br = g_strdup_printf("-device pcie-pci-bridge,bus=%s,id=%s", rootid, id);
> +
> +    args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, root);
> +    args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, br);
> +}
> +
> +static void test_override_scsi_q35(void)
> +{
> +    TestArgs *args = create_args();
> +    CHSResult expected[] = {
> +        {   "/pci@i0cf8/pci-bridge@1/scsi@3/channel@0/disk@0,0",
> +            {10000, 120, 30}
> +        },
> +        {"/pci@i0cf8/pci-bridge@1/scsi@3/channel@0/disk@1,0", {9000, 120, 30} },
> +        {"/pci@i0cf8/pci-bridge@1/scsi@3/channel@0/disk@2,0", {1, 0, 0} },
> +        {"/pci@i0cf8/pci-bridge@1/scsi@3/channel@0/disk@3,0", {0, 1, 0} },
> +        {NULL, {0, 0, 0} }
> +    };
> +    add_drive_with_mbr(args, empty_mbr, 1);
> +    add_drive_with_mbr(args, empty_mbr, 1);
> +    add_drive_with_mbr(args, empty_mbr, 1);
> +    add_drive_with_mbr(args, empty_mbr, 1);
> +    setup_pci_bridge(args, "pcie.0", "br");
> +    add_scsi_controller(args, "lsi53c895a", "br", 3);
> +    add_scsi_disk(args, 0, 0, 0, 0, 0, 10000, 120, 30);
> +    add_scsi_disk(args, 1, 0, 0, 1, 0, 9000, 120, 30);
> +    add_scsi_disk(args, 2, 0, 0, 2, 0, 1, 0, 0);
> +    add_scsi_disk(args, 3, 0, 0, 3, 0, 0, 1, 0);
> +    test_override(args, "q35", expected);
> +}
> +
>   static void test_override_scsi_2_controllers(void)
>   {
>       TestArgs *args = create_args();
> @@ -801,6 +858,22 @@ static void test_override_virtio_blk(void)
>       test_override(args, "pc", expected);
>   }
>   
> +static void test_override_virtio_blk_q35(void)
> +{
> +    TestArgs *args = create_args();
> +    CHSResult expected[] = {
> +        {"/pci@i0cf8/pci-bridge@1/scsi@3/disk@0,0", {10000, 120, 30} },
> +        {"/pci@i0cf8/pci-bridge@1/scsi@4/disk@0,0", {9000, 120, 30} },
> +        {NULL, {0, 0, 0} }
> +    };
> +    add_drive_with_mbr(args, empty_mbr, 1);
> +    add_drive_with_mbr(args, empty_mbr, 1);
> +    setup_pci_bridge(args, "pcie.0", "br");
> +    add_virtio_disk(args, 0, "br", 3, 10000, 120, 30);
> +    add_virtio_disk(args, 1, "br", 4, 9000, 120, 30);
> +    test_override(args, "q35", expected);
> +}
> +
>   static void test_override_zero_chs(void)
>   {
>       TestArgs *args = create_args();
> @@ -812,6 +885,17 @@ static void test_override_zero_chs(void)
>       test_override(args, "pc", expected);
>   }
>   
> +static void test_override_zero_chs_q35(void)
> +{
> +    TestArgs *args = create_args();
> +    CHSResult expected[] = {
> +        {NULL, {0, 0, 0} }
> +    };
> +    add_drive_with_mbr(args, empty_mbr, 1);
> +    add_ide_disk(args, 0, 0, 0, 0, 0, 0);
> +    test_override(args, "q35", expected);
> +}
> +
>   static void test_override_hot_unplug(TestArgs *args, const char *devid,
>                                        CHSResult expected[], CHSResult expected2[])
>   {
> @@ -944,6 +1028,19 @@ int main(int argc, char **argv)
>                          test_override_scsi_hot_unplug);
>           qtest_add_func("hd-geo/override/virtio_hot_unplug",
>                          test_override_virtio_hot_unplug);
> +
> +        if (qtest_has_machine("q35")) {
> +            qtest_add_func("hd-geo/override/sata", test_override_sata);
> +            qtest_add_func("hd-geo/override/virtio_blk_q35",
> +                           test_override_virtio_blk_q35);
> +            qtest_add_func("hd-geo/override/zero_chs_q35",
> +                           test_override_zero_chs_q35);
> +
> +            if (qtest_has_device("lsi53c895a")) {
> +                qtest_add_func("hd-geo/override/scsi_q35",
> +                               test_override_scsi_q35);
> +            }
> +        }
>       } else {
>           g_test_message("QTEST_QEMU_IMG not set or qemu-img missing; "
>                          "skipping hd-geo/override/* tests");

Acked-by: Thomas Huth <thuth@redhat.com>



  reply	other threads:[~2022-10-11 13:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29 22:35 [PATCH v5 0/9] Add 'q35' machine type to hotplug tests Michael Labiuk via
2022-09-29 22:35 ` [PATCH v5 1/9] tests/x86: add helper qtest_qmp_device_del_send() Michael Labiuk via
2022-10-11 10:59   ` Thomas Huth
2022-09-29 22:35 ` [PATCH v5 2/9] tests/x86: Add subtest with 'q35' machine type to device-plug-test Michael Labiuk via
2022-10-11 11:10   ` Thomas Huth
2022-09-29 22:35 ` [PATCH v5 3/9] tests/x86: Refactor hot unplug hd-geo-test Michael Labiuk via
2022-10-11 11:18   ` Thomas Huth
2022-09-29 22:35 ` [PATCH v5 4/9] tests/x86: Add 'q35' machine type to override-tests in hd-geo-test Michael Labiuk via
2022-10-11 11:23   ` Thomas Huth [this message]
2022-09-29 22:35 ` [PATCH v5 5/9] tests/x86: Add 'q35' machine type to hotplug hd-geo-test Michael Labiuk via
2022-10-11 11:24   ` Thomas Huth
2022-09-29 22:35 ` [PATCH v5 6/9] tests/x86: Fix comment typo in drive_del-test Michael Labiuk via
2022-10-11 11:25   ` Thomas Huth
2022-09-29 22:35 ` [PATCH v5 7/9] tests/x86: replace snprint() by g_strdup_printf() " Michael Labiuk via
2022-10-11 11:27   ` Thomas Huth
2022-10-18  6:39   ` Philippe Mathieu-Daudé
2022-09-29 22:35 ` [PATCH v5 8/9] tests/x86: Add 'q35' machine type to drive_del-test Michael Labiuk via
2022-10-11 11:44   ` Thomas Huth
2022-09-29 22:35 ` [PATCH v5 9/9] tests/x86: Add 'q35' machine type to ivshmem-test Michael Labiuk via
2022-10-11 11:54   ` Thomas Huth
2022-10-11 10:18 ` [PING PATCH v5] Add 'q35' machine type to hotplug tests Michael Labiuk
2022-10-11 12:09   ` Thomas Huth

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=19e4252d-5efc-fb09-c714-ffda4a3b5203@redhat.com \
    --to=thuth@redhat.com \
    --cc=den@virtuozzo.com \
    --cc=dgilbert@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=michael.labiuk@virtuozzo.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).