diff --git a/test/test-sync.sh b/test/test-sync.sh index ea26665c9f5f5331d7515a6e16e0a81a23aa77bb..c662da1c067ea3f3b4661de4b693ebe6b825459c 100755 --- a/test/test-sync.sh +++ b/test/test-sync.sh @@ -21,6 +21,19 @@ trap "rm -rf $T" EXIT export SHRINKWRAP_BUILD=$T/build export SHRINKWRAP_PACKAGE=$T/package +cat << EOF > $T/gitconfig +# Needed when not configured in config (e.g. on ci) +[user] + name = Mr T. Ester + email = mr.t.ester@test-sync.sh + +# Needed so we can use local repo paths for submodules +[protocol.file] + allow = always +EOF + +export GIT_CONFIG_GLOBAL=$T/gitconfig + # Test $1 must succeed OK () { local name="$1" @@ -75,7 +88,7 @@ TESTS () { git add README git commit -m "commit 0" - git submodule add ssh://localhost:$T/module1 module + git submodule add file://$T/module1 module git commit -a -m "Add module 1" popd } >> $LOG @@ -406,7 +419,7 @@ TESTS Override branch git add README git commit -a -m "commit 0" - git submodule add ssh://localhost:$T/module2 module + git submodule add file://$T/module2 module git commit -a -m "Add module 2" popd } >> $LOG @@ -455,7 +468,7 @@ TESTS Update module URL { pushd $T/repo2 git submodule set-branch -b main module - git submodule set-url module ssh://localhost:$T/module1 + git submodule set-url module file://$T/module1 git submodule update --remote git commit -a -m "Update module URL" popd diff --git a/test/test.py b/test/test.py index 10c8613753a56af0880bb921214cde0ae05a05be..e39b59ed654285ef7278c99074da9b4846db49ca 100755 --- a/test/test.py +++ b/test/test.py @@ -20,7 +20,9 @@ IMAGE = None FVPJOBS = None -ASSETS = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'assets') +SCRIPTDIR = os.path.dirname(os.path.abspath(__file__)) +SYNCTEST = os.path.join(SCRIPTDIR, 'test-sync.sh') +ASSETS = os.path.join(SCRIPTDIR, 'assets') KERNEL = os.path.join(ASSETS, 'Image') BOOTWRAPPER = os.path.join(ASSETS, 'linux-system.axf') ROOTFS = os.path.join(ASSETS, 'rootfs.ext4') @@ -372,6 +374,14 @@ def do_main(args): build_configs(configs, btvarss=btvarss) run_configs(configs, rtvarss=rtvarss) + # Run repo sync tests. + ret = subprocess.run(SYNCTEST).returncode + results.append({ + 'type': 'repo-sync-behaviours', + 'status': 'pass' if ret == 0 else 'fail', + 'error': None, + }) + success = print_results(args.junit) exit(not success)