]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
oeqa/selftest/buildoptions: Fix test_yocto_source_mirror MIRRORS & PREMIRRORS definitions
authorYoann Congal <yoann.congal@smile.fr>
Fri, 10 Oct 2025 23:11:10 +0000 (01:11 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 13 Oct 2025 17:01:00 +0000 (18:01 +0100)
commitab810d1239d4db0bc0f23db31c70cc9c6e59357e
tree35d6bb3eff005a5a6bd17e1267fee308bf525d93
parent64108679ada885b74fcc6ac49f9e5e983f34e663
oeqa/selftest/buildoptions: Fix test_yocto_source_mirror MIRRORS & PREMIRRORS definitions

Currently, the definitions of MIRRORS and PREMIRRORS made by
test_yocto_source_mirror() are overwritten when run on the autobuilder:
* MIRRORS = "" is extended by mirrors.bbclass to its usual value.
* PREMIRRORS = "* dl.yp.org" is overwritten by the autobuilder.conf
  config fragment to ""

Simplified variable history:
  # $MIRRORS [4 operations]
  #   set .../contribution-yocto/builds/build-qemux86-64-st/conf/selftest.inc:3
  #     ""
  #   append .../contribution-yocto/builds/build-qemux86-64-st/../../layers/poky/meta/classes-global/mirrors.bbclass:57
  #     "${DEBIAN_MIRROR} ..."
  MIRRORS=" http://deb.debian.org/debian/pool ..."

  # $PREMIRRORS [4 operations]
  #   set .../contribution-yocto/builds/build-qemux86-64-st/conf/selftest.inc:18
  #     "    bzr://.*/.*   http://downloads.yoctoproject.org/mirror/sources/ \n ..."
  #   set .../contribution-yocto/builds/build-qemux86-64-st/../../layers/poky/meta/conf/fragments/yocto-autobuilder/autobuilder.conf:6
  #     ""
  #   append .../contribution-yocto/builds/build-qemux86-64-st/../../layers/poky/meta/classes-global/mirrors.bbclass:84
  #     "git://sourceware.org/git/glibc.git https://downloads.yoctoproject.org/mirror/sources/  ..."
  PREMIRRORS=" git://sourceware.org/git/glibc.git https://downloads.yoctoproject.org/mirror/sources/  ..."

Despite this unexpected configuration, the test passes because after
failing to find a PREMIRROR (empty), failing to download the normal
SRC_URI (because of BB_ALLOWED_NETWORKS), the fetcher tries the MIRRORS
which have by default download.yoctoproject.org. For example, on a
failed meta-oe-mirror test[0], we can see a lot of warnings:
"stdio: WARNING: ... do_fetch: Failed to fetch URL https://... attempting MIRRORS if available"

By using the ":forcevariable" override, test_yocto_source_mirror() makes
sure the correct value is set for MIRRORS and PREMIRRORS (whatever is
the configuration).

Simplified variable history (after the fix):
  # $MIRRORS [4 operations]
  #   append .../contribution-yocto/builds/build-qemux86-64-st/../../layers/poky/meta/classes-global/mirrors.bbclass:57
  #     "${DEBIAN_MIRROR} ..."
  #   append .../contribution-yocto/builds/build-qemux86-64-st/../../layers/poky/meta/classes-global/mirrors.bbclass:68
  #     "git://salsa.debian.org/.* ..."
  #   override[forcevariable]:set .../contribution-yocto/builds/build-qemux86-64-st/conf/selftest.inc:3
  #     ""
  MIRRORS=""

  # $PREMIRRORS [4 operations]
  #   set .../contribution-yocto/builds/build-qemux86-64-st/../../layers/poky/meta/conf/fragments/yocto-autobuilder/autobuilder.conf:6
  #     ""
  #   append .../contribution-yocto/builds/build-qemux86-64-st/../../layers/poky/meta/classes-global/mirrors.bbclass:84
  #     "git://sourceware.org/git/glibc.git ..."
  #   override[forcevariable]:set .../contribution-yocto/builds/build-qemux86-64-st/conf/selftest.inc:18
  #     "    bzr://.*/.*   http://downloads.yoctoproject.org/mirror/sources/ ..."
  # pre-expansion value:
  #   "    bzr://.*/.*   http://downloads.yoctoproject.org/mirror/sources/ ..."
  PREMIRRORS="    bzr://.*/.*   http://downloads.yoctoproject.org/mirror/sources/ ..."

[0]: https://autobuilder.yoctoproject.org/valkyrie/#/builders/82/builds/470/steps/17/logs/warnings

Fixes [YOCTO #15993]

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/buildoptions.py