diff options
author | Íñigo Huguet <inigohuguet@hotmail.com> | 2024-03-01 07:56:24 +0000 |
---|---|---|
committer | Íñigo Huguet <inigohuguet@hotmail.com> | 2024-03-01 07:56:24 +0000 |
commit | 14cad33baabc039ae3b763573135724d10f7d9ae (patch) | |
tree | 7baa7fa44b7d740076ca6b19bc2822c0f13e0daa | |
parent | 4c76d49f1f3addddc73ed16853c3c07da78208f1 (diff) | |
parent | 47f01c805d4a3d05da9b8c4242def1646098c65b (diff) |
merge: branch 'jv/test-dist-tarballs'
gitlab-ci: test re-buildability of distribution tarballs
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1862
-rw-r--r-- | .gitlab-ci.yml | 12 | ||||
-rw-r--r-- | .gitlab-ci/ci.template | 2 | ||||
-rwxr-xr-x | .gitlab-ci/run-test.sh | 38 | ||||
-rwxr-xr-x | contrib/scripts/nm-ci-run.sh | 66 | ||||
-rwxr-xr-x | examples/python/gi/checkpoint.py | 8 | ||||
-rwxr-xr-x | tools/test-networkmanager-service.py | 32 |
6 files changed, 107 insertions, 51 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 029284bfb5..eb48c9d1b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,11 +57,11 @@ variables: # # This is done by running `ci-fairy generate-template` and possibly bumping # ".default_tag". - ALPINE_TAG: 'tag-7da44bbacc09' - CENTOS_TAG: 'tag-df11907da86a' - DEBIAN_TAG: 'tag-86a16c2d74d8' - FEDORA_TAG: 'tag-df11907da86a' - UBUNTU_TAG: 'tag-86a16c2d74d8' + ALPINE_TAG: 'tag-947df94197e7' + CENTOS_TAG: 'tag-2f354aa44865' + DEBIAN_TAG: 'tag-fb7953849851' + FEDORA_TAG: 'tag-2f354aa44865' + UBUNTU_TAG: 'tag-fb7953849851' ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh' CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh' @@ -391,6 +391,8 @@ t_fedora:39: - meson+clang - rpm+autotools - rpm+meson + - tarball+autotools + - tarball+meson - tarball - subtree variables: diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index 75606ec24d..f88c0a08a9 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -157,6 +157,8 @@ t_{{distro.name}}:{{version}}: - meson+clang - rpm+autotools - rpm+meson + - tarball+autotools + - tarball+meson - tarball - subtree {% endif %} diff --git a/.gitlab-ci/run-test.sh b/.gitlab-ci/run-test.sh index 758b8ada05..01f3b8bd10 100755 --- a/.gitlab-ci/run-test.sh +++ b/.gitlab-ci/run-test.sh @@ -63,6 +63,8 @@ check_run_assert() { meson+clang rpm+autotools rpm+meson + tarball+autotools + tarball+meson tarball subtree @@ -127,6 +129,42 @@ if check_run_clean tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then do_clean fi +if check_run_clean tarball+autotools; then + BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh + pushd ./build + # dist & build with autotools + make distcheck -j$(nproc) + + # build with meson + DISTSRC="./distsrc-$RANDOM" + mkdir $DISTSRC + tar xvf ./NetworkManager-1*.tar.xz -C $DISTSRC --strip-components=1 + pushd $DISTSRC + BUILD_TYPE=meson CC=gcc WITH_DOCS=1 ../../contrib/scripts/nm-ci-run.sh + popd + popd + do_clean +fi + +if check_run_clean tarball+meson; then + BUILD_TYPE=meson CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh + pushd ./build + # dist with meson + meson dist + + # build with autotools + DISTSRC="./distsrc-$RANDOM" + mkdir $DISTSRC + tar xvf ./meson-dist/NetworkManager-1*.tar.xz -C $DISTSRC --strip-components=1 + pushd $DISTSRC + BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 ../../contrib/scripts/nm-ci-run.sh + popd + rm -rf $DISTSRC + popd + do_clean +fi + + ############################################################################### test_subtree() { diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh index f9d7cf00a8..e385ef1e8d 100755 --- a/contrib/scripts/nm-ci-run.sh +++ b/contrib/scripts/nm-ci-run.sh @@ -191,24 +191,26 @@ run_autotools() { \ #end - make -j 6 - make install - - export NM_TEST_CLIENT_CHECK_L10N=1 - - if ! make check -j 6 -k ; then - _print_test_logs "first-test" - echo ">>>> RUN SECOND TEST (start)" - NMTST_DEBUG="debug,TRACE,no-expect-message" make check -k || : - echo ">>>> RUN SECOND TEST (done)" - _print_test_logs "second-test" - die "autotools test failed" - fi + if [ "$CONFIGURE_ONLY" != 1 ]; then + make -j 6 + make install + + export NM_TEST_CLIENT_CHECK_L10N=1 + + if ! make check -j 6 -k ; then + _print_test_logs "first-test" + echo ">>>> RUN SECOND TEST (start)" + NMTST_DEBUG="debug,TRACE,no-expect-message" make check -k || : + echo ">>>> RUN SECOND TEST (done)" + _print_test_logs "second-test" + die "autotools test failed" + fi - if _with_valgrind; then - if ! NMTST_USE_VALGRIND=1 make check -j 3 -k ; then - _print_test_logs "(valgrind test)" - die "autotools+valgrind test failed" + if _with_valgrind; then + if ! NMTST_USE_VALGRIND=1 make check -j 3 -k ; then + _print_test_logs "(valgrind test)" + die "autotools+valgrind test failed" + fi fi fi popd @@ -222,7 +224,7 @@ run_meson() { else _WITH_WERROR_VAL="" fi - meson build \ + meson setup build \ \ -Dprefix="$PWD/INST" \ \ @@ -262,21 +264,23 @@ run_meson() { export NM_TEST_CLIENT_CHECK_L10N=1 - ninja -C build -v - ninja -C build install + if [ "$CONFIGURE_ONLY" != 1 ]; then + ninja -C build -v + ninja -C build install - if ! meson test -C build -v --print-errorlogs ; then - echo ">>>> RUN SECOND TEST (start)" - NMTST_DEBUG="debug,TRACE,no-expect-message" \ - meson test -C build -v --print-errorlogs || : - echo ">>>> RUN SECOND TEST (done)" - die "meson test failed" - fi + if ! meson test -C build -v --print-errorlogs ; then + echo ">>>> RUN SECOND TEST (start)" + NMTST_DEBUG="debug,TRACE,no-expect-message" \ + meson test -C build -v --print-errorlogs || : + echo ">>>> RUN SECOND TEST (done)" + die "meson test failed" + fi - if _with_valgrind; then - if ! NMTST_USE_VALGRIND=1 meson test -C build -v --print-errorlogs ; then - _print_test_logs "(valgrind test)" - die "meson+valgrind test failed" + if _with_valgrind; then + if ! NMTST_USE_VALGRIND=1 meson test -C build -v --print-errorlogs ; then + _print_test_logs "(valgrind test)" + die "meson+valgrind test failed" + fi fi fi } diff --git a/examples/python/gi/checkpoint.py b/examples/python/gi/checkpoint.py index 6e94b07cbe..7a26554356 100755 --- a/examples/python/gi/checkpoint.py +++ b/examples/python/gi/checkpoint.py @@ -45,9 +45,11 @@ def show(c, ts=None): " timeout: %u seconds%s" % ( rt, - "" - if ts is None - else (" (circa %s sec left)" % ((cr + (rt * 1000) - ts) / 1000.0)), + ( + "" + if ts is None + else (" (circa %s sec left)" % ((cr + (rt * 1000) - ts) / 1000.0)) + ), ) ) print( diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py index f274a460c4..80e7a0012b 100755 --- a/tools/test-networkmanager-service.py +++ b/tools/test-networkmanager-service.py @@ -2329,12 +2329,16 @@ class IP4Config(ExportedObj): a = { "dest": Util.random_ip(seed, net="192.168.0.0/16")[0], "prefix": Util.random_int(seed, 17, 32), - "next-hop": None - if (Util.random_int(seed) % 3 == 0) - else Util.random_ip(seed, net="192.168.0.0/16")[0], - "metric": -1 - if (Util.random_int(seed) % 3 == 0) - else Util.random_int(seed, 0, 0xFFFFFFFF), + "next-hop": ( + None + if (Util.random_int(seed) % 3 == 0) + else Util.random_ip(seed, net="192.168.0.0/16")[0] + ), + "metric": ( + -1 + if (Util.random_int(seed) % 3 == 0) + else Util.random_int(seed, 0, 0xFFFFFFFF) + ), } routes.append(a) @@ -2527,12 +2531,16 @@ class IP6Config(ExportedObj): a = { "dest": Util.random_ip(seed, net="2001:a::/64")[0], "prefix": Util.random_int(seed, 65, 128), - "next-hop": None - if (Util.random_int(seed) % 3 == 0) - else Util.random_ip(seed, net="2001:a::/64")[0], - "metric": -1 - if (Util.random_int(seed) % 3 == 0) - else Util.random_int(seed, 0, 0xFFFFFFFF), + "next-hop": ( + None + if (Util.random_int(seed) % 3 == 0) + else Util.random_ip(seed, net="2001:a::/64")[0] + ), + "metric": ( + -1 + if (Util.random_int(seed) % 3 == 0) + else Util.random_int(seed, 0, 0xFFFFFFFF) + ), } routes.append(a) |