Commit 8c5e7bdd authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/huth/tags/pull-request-2018-02-14' into staging



Various improvements to the qtest checks:
- Clean-ups by Eric Blake with regards to the global_qtest variable
- Some more test cases for the boot-serial tester
- Re-activation of the m48t59-test

# gpg: Signature made Wed 14 Feb 2018 11:07:44 GMT
# gpg:                using RSA key 2ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>"
# gpg:                 aka "Thomas Huth <thuth@redhat.com>"
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>"
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>"
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth/tags/pull-request-2018-02-14:
  tests/m48t59: Use the m48t59 test on ppc, too
  tests/Makefile: Derive check-qtest-ppc64-y from check-qtest-ppc-y
  tests/m48t59: Make the test independent of global_qtest
  tests/m48t59: Fix and re-enable the test for sparc
  tests/boot-serial-test: Add support for the aarch64 virt machine
  tests/boot-serial: Add tests for PowerPC Mac machines
  tests/boot-serial: Enable the boot-serial test on SPARC machines, too
  wdt_ib700-test: Drop dependence on global_qtest
  tests/boot-sector: Drop dependence on global_qtest
  qmp-test: Drop dependence on global_qtest
  libqos: Use explicit QTestState for remaining libqos operations
  libqos: Use explicit QTestState for ahci operations
  libqos: Use explicit QTestState for i2c operations
  libqos: Use explicit QTestState for rtas operations
  libqos: Use explicit QTestState for fw_cfg operations
  libqos: Track QTestState with QPCIBus
  libqtest: Use qemu_strtoul()
  tests: Clean up wait for event

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 9f9c5336 02f4fbec
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -319,16 +319,15 @@ check-qtest-ppc-y += tests/boot-order-test$(EXESUF)
check-qtest-ppc-y += tests/prom-env-test$(EXESUF)
check-qtest-ppc-y += tests/drive_del-test$(EXESUF)
check-qtest-ppc-y += tests/boot-serial-test$(EXESUF)
check-qtest-ppc-y += tests/m48t59-test$(EXESUF)
gcov-files-ppc-y += hw/timer/m48t59.c

check-qtest-ppc64-y = tests/spapr-phb-test$(EXESUF)
gcov-files-ppc64-y = ppc64-softmmu/hw/ppc/spapr_pci.c
check-qtest-ppc64-y += tests/endianness-test$(EXESUF)
check-qtest-ppc64-y += tests/boot-order-test$(EXESUF)
check-qtest-ppc64-y += tests/prom-env-test$(EXESUF)
check-qtest-ppc64-y = $(check-qtest-ppc-y)
gcov-files-ppc64-y = $(subst ppc-softmmu/,ppc64-softmmu/,$(gcov-files-ppc-y))
check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
gcov-files-ppc64-y += ppc64-softmmu/hw/ppc/spapr_pci.c
check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF)
check-qtest-ppc64-y += tests/drive_del-test$(EXESUF)
check-qtest-ppc64-y += tests/migration-test$(EXESUF)
check-qtest-ppc64-y += tests/boot-serial-test$(EXESUF)
check-qtest-ppc64-y += tests/rtas-test$(EXESUF)
check-qtest-ppc64-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF)
check-qtest-ppc64-y += tests/usb-hcd-ohci-test$(EXESUF)
@@ -351,13 +350,13 @@ check-qtest-sh4-y = tests/endianness-test$(EXESUF)
check-qtest-sh4eb-y = tests/endianness-test$(EXESUF)

check-qtest-sparc-y = tests/prom-env-test$(EXESUF)
#check-qtest-sparc-y += tests/m48t59-test$(EXESUF)
#gcov-files-sparc-y = hw/timer/m48t59.c
check-qtest-sparc-y += tests/m48t59-test$(EXESUF)
gcov-files-sparc-y = hw/timer/m48t59.c
check-qtest-sparc-y += tests/boot-serial-test$(EXESUF)

check-qtest-sparc64-y = tests/endianness-test$(EXESUF)
#check-qtest-sparc64-y += tests/m48t59-test$(EXESUF)
#gcov-files-sparc64-y += hw/timer/m48t59.c
check-qtest-sparc64-y += tests/prom-env-test$(EXESUF)
check-qtest-sparc64-y += tests/boot-serial-test$(EXESUF)

check-qtest-arm-y = tests/tmp105-test$(EXESUF)
check-qtest-arm-y += tests/ds1338-test$(EXESUF)
@@ -372,6 +371,7 @@ check-qtest-arm-y += tests/sdhci-test$(EXESUF)

check-qtest-aarch64-y = tests/numa-test$(EXESUF)
check-qtest-aarch64-y += tests/sdhci-test$(EXESUF)
check-qtest-aarch64-y += tests/boot-serial-test$(EXESUF)

check-qtest-microblazeel-y = $(check-qtest-microblaze-y)

+2 −1
Original line number Diff line number Diff line
@@ -158,10 +158,11 @@ static AHCIQState *ahci_vboot(const char *cli, va_list ap)

    s = g_new0(AHCIQState, 1);
    s->parent = qtest_pc_vboot(cli, ap);
    global_qtest = s->parent->qts;
    alloc_set_flags(s->parent->alloc, ALLOC_LEAK_ASSERT);

    /* Verify that we have an AHCI device present. */
    s->dev = get_ahci_device(&s->fingerprint);
    s->dev = get_ahci_device(s->parent->qts, &s->fingerprint);

    return s;
}
+1 −1
Original line number Diff line number Diff line
@@ -668,7 +668,7 @@ static void test_acpi_one(const char *params, test_data *data)

    qtest_start(args);

    boot_sector_test();
    boot_sector_test(global_qtest);

    data->tables = g_array_new(false, true, sizeof(AcpiSdtTable));
    test_acpi_rsdp_address(data);
+4 −4
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ static void test_a_boot_order(const char *machine,
     * system_reset only requests reset.  We get a RESET event after
     * the actual reset completes.  Need to wait for that.
     */
    qmp_discard_response("");   /* HACK: wait for event */
    qmp_eventwait("RESET");
    actual = read_boot_order();
    g_assert_cmphex(actual, ==, expected_reboot);
    qtest_quit(global_qtest);
@@ -132,7 +132,7 @@ static void test_prep_boot_order(void)

static uint64_t read_boot_order_pmac(void)
{
    QFWCFG *fw_cfg = mm_fw_cfg_init(0xf0000510);
    QFWCFG *fw_cfg = mm_fw_cfg_init(global_qtest, 0xf0000510);

    return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE);
}
@@ -157,7 +157,7 @@ static void test_pmac_newworld_boot_order(void)

static uint64_t read_boot_order_sun4m(void)
{
    QFWCFG *fw_cfg = mm_fw_cfg_init(0xd00000510ULL);
    QFWCFG *fw_cfg = mm_fw_cfg_init(global_qtest, 0xd00000510ULL);

    return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE);
}
@@ -169,7 +169,7 @@ static void test_sun4m_boot_order(void)

static uint64_t read_boot_order_sun4u(void)
{
    QFWCFG *fw_cfg = io_fw_cfg_init(0x510);
    QFWCFG *fw_cfg = io_fw_cfg_init(global_qtest, 0x510);

    return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE);
}
+4 −4
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ int boot_sector_init(char *fname)
}

/* Loop until signature in memory is OK.  */
void boot_sector_test(void)
void boot_sector_test(QTestState *qts)
{
    uint8_t signature_low;
    uint8_t signature_high;
@@ -146,8 +146,8 @@ void boot_sector_test(void)
     * instruction.
     */
    for (i = 0; i < TEST_CYCLES; ++i) {
        signature_low = readb(SIGNATURE_ADDR);
        signature_high = readb(SIGNATURE_ADDR + 1);
        signature_low = qtest_readb(qts, SIGNATURE_ADDR);
        signature_high = qtest_readb(qts, SIGNATURE_ADDR + 1);
        signature = (signature_high << 8) | signature_low;
        if (signature == SIGNATURE) {
            break;
Loading