[PATCH] tests: Compile virgdbusmock.c with GIO_COMPILATION enabled

Andrea Bolognani abologna at redhat.com
Wed Mar 29 09:52:16 UTC 2023


On Wed, Mar 29, 2023 at 11:08:56AM +0200, Michal Prívozník wrote:
> On 3/28/23 14:54, Andrea Bolognani wrote:
> > Anyway my point is that, at least as far as I can tell, all of the
> > test programs that use virgdbusmock are effectively no-op on Windows,
> > which means that mocking gdbus on Windows should not be necessary and
> > thus not building the mock library on that platform should be viable.
> >
> > Other mocks might work on Windows, I'm not sure. I haven't
> > investigated, and I'm not making blanket statements about the topic.
> > I'm only discussing this specific mock, which is the one currently
> > causing us grief and which looks like we could simply stop building
> > on Windows without losing anything in the process.
>
> Ha, so after many failed attempts I am able to compile and *RUN* our
> test suite under wine. I needed to hack the meson cross file mingw
> ships. Anyway, what I'm seeing is couple of failed tests:
>
>
>  14/213 libvirt / domaincapstest         FAIL  0.84s   exit status 1
>  27/213 libvirt / sockettest             FAIL  0.42s   exit status 1
>  28/213 libvirt / sysinfotest            FAIL  0.44s   exit status 1
>  29/213 libvirt / storagevolxml2xmltest  FAIL  0.46s   exit status 1
>  38/213 libvirt / vircryptotest          FAIL  0.42s   exit status 1
>  41/213 libvirt / virfilecachetest       FAIL  0.44s   exit status 1
>  46/213 libvirt / viridentitytest        FAIL  0.44s   exit status 3
>  50/213 libvirt / virlockspacetest       FAIL  0.36s   exit status 1
>  57/213 libvirt / virrotatingfiletest    FAIL  0.45s   exit status 1
>  59/213 libvirt / virstringtest          FAIL  0.44s   exit status 1
>  65/213 libvirt / vshtabletest           FAIL  0.44s   exit status 1
>
>
> Now, some of these are true bugs (either in our code or in wine). I'll
> try to post patches. Nevertheless, I can confirm that mocking works with
> .dll too.

Excellent stuff!

> Therefore, I'd like to continue building mocks AND keep this
> original patch as is.

Can you please clarify whether the three tests[1] that use
virgdbusmock (networkxml2firewalltest, virsystemdtest, virpolkittest)
run successfully under Wine and, if so, whether they do anything more
interesting than returning EXIT_AM_SKIP? Or can be modified to do so?

It seems to me that they're testing Unix-only features, so we're
never going to be able to meaningfully run them on Windows. And since
they're the only ones using virgdbusmock, going out of our way to
build that mock on Windows only for it to remain unused is pointless.

Again, I'm only talking about virgdbusmock here! All the other mocks
should clearly continue being built on Windows.


[1] I initially included virfirewalltest in the list, but that was
    incorrect as the relevant code is compiled out.
-- 
Andrea Bolognani / Red Hat / Virtualization



More information about the libvir-list mailing list