mirror of
https://git.yoctoproject.org/poky
synced 2026-06-22 07:53:48 +02:00
git protocol accesses to our infrastructure are currently struggling and this has highlighted a number of places we're making those obsolete access forms. Update them to use https instead of the git protocol since it is preferred and more reliable. The devtool test needed quoting to handle the ';' in the url. The -f option to devtool also shows a deprecation warning so remove that. There were internal references to git protocol urls inside the nested git submodules test report, which means those repos need updating to use new git revisions. (From OE-Core rev: cbb3e323b74d4351c772a9bcd553008c31a220f0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1ceba42623c5187d2f5a100d6a523abcdc75d34e) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Paul Barker <paul@pbarker.dev>
40 lines
1.4 KiB
Python
40 lines
1.4 KiB
Python
#
|
|
# Copyright OpenEmbedded Contributors
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
#
|
|
|
|
import os
|
|
import sys
|
|
import subprocess
|
|
import shutil
|
|
from oeqa.selftest.case import OESelftestTestCase
|
|
from yocto_testresults_query import get_sha1, create_workdir
|
|
basepath = os.path.abspath(os.path.dirname(__file__) + '/../../../../../')
|
|
lib_path = basepath + '/scripts/lib'
|
|
sys.path = sys.path + [lib_path]
|
|
|
|
|
|
class TestResultsQueryTests(OESelftestTestCase):
|
|
def test_get_sha1(self):
|
|
test_data_get_sha1 = [
|
|
{"input": "yocto-4.0", "expected": "00cfdde791a0176c134f31e5a09eff725e75b905"},
|
|
{"input": "4.1_M1", "expected": "95066dde6861ee08fdb505ab3e0422156cc24fae"},
|
|
]
|
|
for data in test_data_get_sha1:
|
|
test_name = data["input"]
|
|
with self.subTest(f"Test SHA1 from {test_name}"):
|
|
self.assertEqual(
|
|
get_sha1(basepath, data["input"]), data["expected"])
|
|
|
|
def test_create_workdir(self):
|
|
workdir = create_workdir()
|
|
try:
|
|
url = subprocess.check_output(
|
|
["git", "-C", workdir, "remote", "get-url", "origin"]).strip().decode("utf-8")
|
|
except:
|
|
shutil.rmtree(workdir, ignore_errors=True)
|
|
self.fail(f"Can not execute git commands in {workdir}")
|
|
shutil.rmtree(workdir)
|
|
self.assertEqual(url, "https://git.yoctoproject.org/yocto-testresults")
|