lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

October 2024

  • 1 participants
  • 1631 discussions
[XS] Change in ...osmo_dia2gsup[master]: diameter: fix unused macro param in ?SERVICE
by fixeria 10 Oct '24

10 Oct '24
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/38378?usp=email ) Change subject: diameter: fix unused macro param in ?SERVICE ...................................................................... diameter: fix unused macro param in ?SERVICE Change-Id: Ia0e87b19541b3e4064e5095cc5fefa016700d226 --- M src/osmo_dia2gsup.erl 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo_dia2gsup refs/changes/78/38378/1 diff --git a/src/osmo_dia2gsup.erl b/src/osmo_dia2gsup.erl index 7aabc1c..a2a15b4 100644 --- a/src/osmo_dia2gsup.erl +++ b/src/osmo_dia2gsup.erl @@ -63,7 +63,7 @@ {'Origin-Realm', application:get_env(osmo_dia2gsup, origin_realm, "localdomain")}, {'Vendor-Id', application:get_env(osmo_dia2gsup, vendor_id, 0)}, {'Origin-State-Id', diameter:origin_state_id()}, - {'Product-Name', "osmo_dia2gsup"}, + {'Product-Name', Name}, {'Auth-Application-Id', []}, {'Vendor-Specific-Application-Id', [?APPID_S6]}, {application, @@ -99,8 +99,7 @@ %% @callback gen_server init(State) -> % DIAMETER side - SvcName = ?MODULE, - diameter:start_service(SvcName, ?SERVICE(SvcName)), + diameter:start_service(?SVC_NAME, ?SERVICE(?MODULE)), Ip = application:get_env(osmo_dia2gsup, diameter_ip, "127.0.0.8"), Port = application:get_env(osmo_dia2gsup, diameter_port, 3868), -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/38378?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo_dia2gsup Gerrit-Branch: master Gerrit-Change-Id: Ia0e87b19541b3e4064e5095cc5fefa016700d226 Gerrit-Change-Number: 38378 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[XS] Change in ...osmo_dia2gsup[master]: diameter: drop unused ?DIA_STATS_* macros
by fixeria 10 Oct '24

10 Oct '24
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/38379?usp=email ) Change subject: diameter: drop unused ?DIA_STATS_* macros ...................................................................... diameter: drop unused ?DIA_STATS_* macros Change-Id: I923c2442cadd39bb6d1c62d2d522ca2a178240a5 --- M src/osmo_dia2gsup.erl 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo_dia2gsup refs/changes/79/38379/1 diff --git a/src/osmo_dia2gsup.erl b/src/osmo_dia2gsup.erl index a2a15b4..eab34a3 100644 --- a/src/osmo_dia2gsup.erl +++ b/src/osmo_dia2gsup.erl @@ -50,9 +50,6 @@ % Diameter application definitions --define(DIA_STATS_TAB, iwf_stats). --define(DIA_STATS_COUNTERS, [event_OK, event_ERR]). - -define(SVC_NAME, ?MODULE). -define(APP_ALIAS, ?MODULE). -define(CALLBACK_MOD, server_cb). -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/38379?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo_dia2gsup Gerrit-Branch: master Gerrit-Change-Id: I923c2442cadd39bb6d1c62d2d522ca2a178240a5 Gerrit-Change-Number: 38379 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[XS] Change in ...osmo_dia2gsup[master]: diameter: fix wrong 'Vendor-Id' value (should be 3GPP)
by fixeria 10 Oct '24

10 Oct '24
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/38377?usp=email ) Change subject: diameter: fix wrong 'Vendor-Id' value (should be 3GPP) ...................................................................... diameter: fix wrong 'Vendor-Id' value (should be 3GPP) Wireshark decodes VID=10515 as follows: Vendor-Id: Terry Nazon Inc (10515) Looks like a typo, it should be VID=10415: Vendor-Id: 3GPP (10415) At least this is what open5gs is using. Change-Id: I601785a8c71e9c6e6d94018586e2a865ba8b2f11 --- M src/osmo_dia2gsup.erl 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo_dia2gsup refs/changes/77/38377/1 diff --git a/src/osmo_dia2gsup.erl b/src/osmo_dia2gsup.erl index d1c9fda..7aabc1c 100644 --- a/src/osmo_dia2gsup.erl +++ b/src/osmo_dia2gsup.erl @@ -58,7 +58,7 @@ -define(CALLBACK_MOD, server_cb). -define(DIAMETER_DICT_HSS, diameter_3gpp_ts29_272). --define(APPID_S6, #'diameter_base_Vendor-Specific-Application-Id'{'Vendor-Id'=10515, 'Auth-Application-Id'=[16777251]}). +-define(APPID_S6, #'diameter_base_Vendor-Specific-Application-Id'{'Vendor-Id'=10415, 'Auth-Application-Id'=[16777251]}). -define(SERVICE(Name), [{'Origin-Host', application:get_env(osmo_dia2gsup, origin_host, "hss.localdomain")}, {'Origin-Realm', application:get_env(osmo_dia2gsup, origin_realm, "localdomain")}, {'Vendor-Id', application:get_env(osmo_dia2gsup, vendor_id, 0)}, -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/38377?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo_dia2gsup Gerrit-Branch: master Gerrit-Change-Id: I601785a8c71e9c6e6d94018586e2a865ba8b2f11 Gerrit-Change-Number: 38377 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[L] Change in libosmo-sigtran[master]: ss7 vty: Fix insert order of routes with higher priority
by osmith 10 Oct '24

10 Oct '24
Attention is currently required from: fixeria, pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38375?usp=email ) Change subject: ss7 vty: Fix insert order of routes with higher priority ...................................................................... Patch Set 4: Code-Review+1 (2 comments) File src/osmo_ss7.c: https://gerrit.osmocom.org/c/libosmo-sigtran/+/38375/comment/ef2f12e9_ed0c1… : PS3, Line 736: return -ENODEV; > I prefer keeping it this way since the typology of return is different here. […] Acknowledged File src/osmo_ss7_vty.c: https://gerrit.osmocom.org/c/libosmo-sigtran/+/38375/comment/c70ef940_748fb… : PS3, Line 401: find > The real only expected cause of this failing here is that the linkset cannot be found, so it's far m […] Acknowledged -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38375?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I6e7b5e3f06ae2c9468da58c55d2f42cbcd777218 Gerrit-Change-Number: 38375 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Thu, 10 Oct 2024 15:16:54 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: osmith <osmith(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ci[master]: jobs/ttcn3-testsuites-testenv: move ggsn testsuite
by osmith 10 Oct '24

10 Oct '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/38346?usp=email ) Change subject: jobs/ttcn3-testsuites-testenv: move ggsn testsuite ...................................................................... jobs/ttcn3-testsuites-testenv: move ggsn testsuite Run the GGSN testsuite in all combinations (osmo-ggsn, osmo-ggsn with various kernels and kernel gtp-u, open5gs) with testenv. Depends: osmo-ttcn3-hacks I3f9db4325d5928c809cc99bc82d9cb82bf9e71eb Change-Id: I5b70944bd1fa9c90c5ad51b9026fdcd969bfc8a8 --- M jobs/ttcn3-testsuites-testenv.yml M jobs/ttcn3-testsuites.yml 2 files changed, 75 insertions(+), 105 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/jobs/ttcn3-testsuites-testenv.yml b/jobs/ttcn3-testsuites-testenv.yml index b5180f1..f966b67 100644 --- a/jobs/ttcn3-testsuites-testenv.yml +++ b/jobs/ttcn3-testsuites-testenv.yml @@ -10,8 +10,13 @@ See <a href="https://osmocom.org/projects/cellular-infrastructure/wiki/Titan_TTCN3_Tests…"> TTCN3 Testsuite</a> for more information.<br> <br> - Arguments: <code>{args}</code> + Arguments:<br> + <code>{args}</code><br> + <br> + Kernel:<br> + <code>{kernel}</code><br> timer: "@midnight" + kernel: "none" node: ttcn3 jobs: - "{job-name}" @@ -93,6 +98,34 @@ args: -b osmocom:nightly timer: H 07 * * * + - ttcn3-ggsn-test: + testsuite: ggsn + args: -b osmocom:nightly -c 'osmo_ggsn_*' + timer: H 07 * * * + + - ttcn3-ggsn-test-kernel: + testsuite: ggsn + args: -b osmocom:nightly -c 'osmo_ggsn_v*_only' --debian-kernel + timer: H 07 * * * + + - ttcn3-ggsn-test-kernel-net-next: + testsuite: ggsn + args: -b osmocom:nightly -c 'osmo_ggsn_v*_only' --custom-kernel + kernel: net-next + timer: H 07 * * * + + - ttcn3-ggsn-test-kernel-torvalds: + testsuite: ggsn + args: -b osmocom:nightly -c 'osmo_ggsn_v*_only' --custom-kernel + kernel: torvalds + timer: H 07 * * * + + - ttcn3-ggsn-test-ogs: + testsuite: ggsn + args: -b osmocom:nightly -c open5gs + timer: H 07 * * * + email: jenkins-notifications(a)lists.osmocom.org acetcom(a)gmail.com + # --------------------------------------------- # Debian latest # --------------------------------------------- @@ -148,6 +181,28 @@ timer: H 10 * * * disabled: true # disable until > 0.1.x release + - ttcn3-ggsn-test-latest: + testsuite: ggsn + args: -b osmocom:latest -c 'osmo_ggsn_*' + timer: H 10 * * * + + - ttcn3-ggsn-test-kernel-latest: + testsuite: ggsn + args: -b osmocom:latest -c 'osmo_ggsn_*' --kernel-debian + timer: H 10 * * * + + - ttcn3-ggsn-test-kernel-latest-net-next: + testsuite: ggsn + args: -b osmocom:latest -c 'osmo_ggsn_v*_only' --kernel-custom + kernel: net-next + timer: H 10 * * * + + - ttcn3-ggsn-test-kernel-latest-torvalds: + testsuite: ggsn + args: -b osmocom:latest -c 'osmo_ggsn_v*_only' --kernel-custom + kernel: torvalds + timer: H 10 * * * + # --------------------------------------------- # Debian nightly + io_uring (OS#6357) # --------------------------------------------- @@ -199,6 +254,11 @@ args: -b osmocom:nightly:asan -c generic timer: H 12 * * * + - ttcn3-ggsn-test-asan: + testsuite: ggsn + args: -b osmocom:nightly:asan -c 'osmo_ggsn_*' + timer: H 12 * * * + - job-template: name: '{job-name}' project-type: freestyle @@ -213,13 +273,24 @@ Branch of <code>osmo-ttcn3-hacks.git</code> default: 'master' builders: + - copyartifact: + project: "build-kernel-{kernel}" + filter: "output/linux" + flatten: true + which-build: last-successful + stable: true - shell: |- DISTRO="debian:bookworm" IMAGE="registry.osmocom.org/osmocom-build/"$(echo "$DISTRO" | tr : -)"-osmo-ttcn3-testenv" + KERNEL="{kernel}" podman pull "$IMAGE" - rm -rf logs _cache + rm -rf logs _cache .linux + + if [ "$KERNEL" != "none" ]; then + mv linux .linux + fi set +x # Don't output the color codes we set here export TESTENV_COLOR_DEBUG="$(printf '\e[0;94m')" # light blue @@ -229,6 +300,7 @@ export TESTENV_COLOR_CRITICAL="$(printf '\e[1;91m')" # bold, red export TESTENV_SOURCE_HIGHLIGHT_COLORS="esc" export TESTENV_NO_IMAGE_UP_TO_DATE_CHECK=1 + export TESTENV_NO_KVM=1 set -x ./testenv.py run \ @@ -241,7 +313,7 @@ # Free up space from downloaded apt packages, build artifacts etc. # The osmo-ttcn3-hacks deps dir and ccache are persistent. - rm -rf _cache + rm -rf _cache .linux scm: - git: diff --git a/jobs/ttcn3-testsuites.yml b/jobs/ttcn3-testsuites.yml index 98becb5..55eb9aa 100644 --- a/jobs/ttcn3-testsuites.yml +++ b/jobs/ttcn3-testsuites.yml @@ -26,57 +26,6 @@ timer: H 04 * * * - nplab-sua-test: timer: H 04 * * * - - ttcn3-ggsn-test: - timer: H 04 * * * - - ttcn3-ggsn-test-kernel: - timer: H 04 * * * - description: | - Test osmo-ggsn master with the Debian kernel. - - ttcn3-ggsn-test-kernel-net-next: - timer: H 04 * * * - # Cache the linux source tree in the workspace of one node - wipe_workspace: false - node: ttcn3-ggsn-test-kernel-git - description: | - Test osmo-ggsn master with the Linux kernel built from master of - <a href="https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/"> - net-next.git</a>. - - ttcn3-ggsn-test-kernel-torvalds: - timer: H 04 * * * - # Cache the linux source tree in the workspace of one node - wipe_workspace: false - node: ttcn3-ggsn-test-kernel-git - description: | - Test osmo-ggsn master with the Linux kernel built from master of - <a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/"> - torvalds/linux.git</a>. - - ttcn3-ggsn-test-kernel-latest: - timer: H 04 * * * - description: | - Test osmo-ggsn latest with the Debian kernel. - - ttcn3-ggsn-test-kernel-latest-net-next: - timer: H 04 * * * - # Cache the linux source tree in the workspace of one node - wipe_workspace: false - node: ttcn3-ggsn-test-kernel-git - description: | - Test osmo-ggsn latest with the Linux kernel built from master of - <a href="https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/"> - net-next.git</a>. - - ttcn3-ggsn-test-kernel-latest-torvalds: - timer: H 04 * * * - # Cache the linux source tree in the workspace of one node - wipe_workspace: false - node: ttcn3-ggsn-test-kernel-git - description: | - Test osmo-ggsn latest with the Linux kernel built from master of - <a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/"> - torvalds/linux.git</a>. - - ttcn3-ggsn-test-ogs: - timer: H 04 * * * - description: | - Test open5gs-smfd + open5gs-upfd main. - email: jenkins-notifications(a)lists.osmocom.org acetcom(a)gmail.com - ttcn3-pcu-test: timer: H 04 * * * - ttcn3-pcu-test-sns: @@ -136,8 +85,6 @@ timer: H 07 * * * - nplab-sua-test-latest: timer: H 08 * * * - - ttcn3-ggsn-test-latest: - timer: H 08 * * * - ttcn3-msc-test-latest: timer: H 08 * * * - ttcn3-pcu-test-latest: @@ -205,8 +152,6 @@ timer: H 12 * * * - ttcn3-gbproxy-test-asan: timer: H 12 * * * - - ttcn3-ggsn-test-asan: - timer: H 12 * * * - ttcn3-hnbgw-test-asan: timer: H 12 * * * - ttcn3-msc-test-asan: @@ -244,53 +189,6 @@ # Translate job name to docker-playground dir and relevant # environment variables case "{job-name}" in - ttcn3-ggsn-test-kernel) - DIR="ttcn3-ggsn-test" - export IMAGE_SUFFIX="master" - # Run against debian's kernel - export KERNEL_TEST=1 - ;; - ttcn3-ggsn-test-kernel-net-next) - DIR="ttcn3-ggsn-test" - export IMAGE_SUFFIX="master" - export KERNEL_TEST=1 - export KERNEL_BUILD=1 - export KERNEL_URL="https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git" - export KERNEL_REMOTE_NAME="net-next" - export KERNEL_BRANCH="main" - ;; - ttcn3-ggsn-test-kernel-torvalds) - DIR="ttcn3-ggsn-test" - export IMAGE_SUFFIX="master" - export KERNEL_TEST=1 - export KERNEL_BUILD=1 - export KERNEL_URL="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git" - export KERNEL_REMOTE_NAME="torvalds" - export KERNEL_BRANCH="master" - ;; - ttcn3-ggsn-test-kernel-latest) - DIR="ttcn3-ggsn-test" - export IMAGE_SUFFIX="latest" - export KERNEL_TEST=1 - ;; - ttcn3-ggsn-test-kernel-latest-net-next) - DIR="ttcn3-ggsn-test" - export IMAGE_SUFFIX="latest" - export KERNEL_TEST=1 - export KERNEL_BUILD=1 - export KERNEL_URL="https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git" - export KERNEL_REMOTE_NAME="net-next" - export KERNEL_BRANCH="main" - ;; - ttcn3-ggsn-test-kernel-latest-torvalds) - DIR="ttcn3-ggsn-test" - export IMAGE_SUFFIX="latest" - export KERNEL_TEST=1 - export KERNEL_BUILD=1 - export KERNEL_URL="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git" - export KERNEL_REMOTE_NAME="torvalds" - export KERNEL_BRANCH="master" - ;; TTCN3-centos7-*-latest) DIR="$(echo "{job-name}" | sed s/^TTCN3-centos7\-/ttcn3-/ | sed s/\-latest$//)" export IMAGE_SUFFIX="latest-centos7" -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/38346?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I5b70944bd1fa9c90c5ad51b9026fdcd969bfc8a8 Gerrit-Change-Number: 38346 Gerrit-PatchSet: 4 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: ggsn: testenv: change VTY IP
by osmith 10 Oct '24

10 Oct '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38371?usp=email ) Change subject: ggsn: testenv: change VTY IP ...................................................................... ggsn: testenv: change VTY IP Access the VTY of osmo-ggsn via 172.18.3.2 (127.0.0.2 if running without testenv), so the testsuite can access the VTY when osmo-ggsn optionally runs in QEMU too (through the bridge). Change-Id: I054c19041b3027e7f66d925f031002fefe011c58 --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/osmo-ggsn/osmo-ggsn.src.cfg M ggsn_tests/testenv_osmo_ggsn_all.cfg M ggsn_tests/testenv_osmo_ggsn_v4_only.cfg M ggsn_tests/testenv_osmo_ggsn_v4v6_only.cfg M ggsn_tests/testenv_osmo_ggsn_v6_only.cfg 6 files changed, 6 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index 6b27bf6..e8888e9 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -9,8 +9,8 @@ [LOGGING] *.JUnitLogger.testsuite_name := "osmo-ttcn3-hacks/ggsn_tests" - [TESTPORT_PARAMETERS] +*.GGSNVTY.CTRL_HOSTNAME := "127.0.0.2" [MODULE_PARAMETERS] # our Own IP address diff --git a/ggsn_tests/osmo-ggsn/osmo-ggsn.src.cfg b/ggsn_tests/osmo-ggsn/osmo-ggsn.src.cfg index 23a21f4..a01ce5b 100644 --- a/ggsn_tests/osmo-ggsn/osmo-ggsn.src.cfg +++ b/ggsn_tests/osmo-ggsn/osmo-ggsn.src.cfg @@ -42,7 +42,7 @@ ! line vty no login - bind 0.0.0.0 + bind 127.0.0.2 ! ggsn ggsn0 gtp state-dir /tmp diff --git a/ggsn_tests/testenv_osmo_ggsn_all.cfg b/ggsn_tests/testenv_osmo_ggsn_all.cfg index 54660be..4c33b43 100644 --- a/ggsn_tests/testenv_osmo_ggsn_all.cfg +++ b/ggsn_tests/testenv_osmo_ggsn_all.cfg @@ -9,3 +9,4 @@ copy=osmo-ggsn clean=osmo-ggsn/testenv.sh all vty_port=4260 +vty_host=172.18.3.2 diff --git a/ggsn_tests/testenv_osmo_ggsn_v4_only.cfg b/ggsn_tests/testenv_osmo_ggsn_v4_only.cfg index 3b55af2..57e736f 100644 --- a/ggsn_tests/testenv_osmo_ggsn_v4_only.cfg +++ b/ggsn_tests/testenv_osmo_ggsn_v4_only.cfg @@ -9,3 +9,4 @@ copy=osmo-ggsn clean=osmo-ggsn/testenv.sh v4_only vty_port=4260 +vty_host=172.18.3.2 diff --git a/ggsn_tests/testenv_osmo_ggsn_v4v6_only.cfg b/ggsn_tests/testenv_osmo_ggsn_v4v6_only.cfg index da738f2..6f0e11f 100644 --- a/ggsn_tests/testenv_osmo_ggsn_v4v6_only.cfg +++ b/ggsn_tests/testenv_osmo_ggsn_v4v6_only.cfg @@ -9,3 +9,4 @@ copy=osmo-ggsn clean=osmo-ggsn/testenv.sh v4v6_only vty_port=4260 +vty_host=172.18.3.2 diff --git a/ggsn_tests/testenv_osmo_ggsn_v6_only.cfg b/ggsn_tests/testenv_osmo_ggsn_v6_only.cfg index 4d65b73..101538f 100644 --- a/ggsn_tests/testenv_osmo_ggsn_v6_only.cfg +++ b/ggsn_tests/testenv_osmo_ggsn_v6_only.cfg @@ -9,3 +9,4 @@ copy=osmo-ggsn clean=osmo-ggsn/testenv.sh v6_only vty_port=4260 +vty_host=172.18.3.2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38371?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I054c19041b3027e7f66d925f031002fefe011c58 Gerrit-Change-Number: 38371 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: ggsn: testenv: run SUT on bridge instead of lo
by osmith 10 Oct '24

10 Oct '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38341?usp=email ) Change subject: ggsn: testenv: run SUT on bridge instead of lo ...................................................................... ggsn: testenv: run SUT on bridge instead of lo Replace IPs in testenv.sh so the SUT runs on 172.18.3.2 (testenv0 bridge) instead of 127.0.0.2 (lo). Later on when we can optionally use QEMU with osmo-ggsn to test kernel GTP-U. It will then run on this IP as well. So with this change we can use the same IP for both the QEMU and non-QEMU case. Change-Id: Ib768603b0050fe62baff39cab982a850eb91f49a --- M ggsn_tests/osmo-ggsn/testenv.sh 1 file changed, 13 insertions(+), 1 deletion(-) Approvals: fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn_tests/osmo-ggsn/testenv.sh b/ggsn_tests/osmo-ggsn/testenv.sh index bded804..4155d52 100755 --- a/ggsn_tests/osmo-ggsn/testenv.sh +++ b/ggsn_tests/osmo-ggsn/testenv.sh @@ -22,11 +22,21 @@ esac } +replace_ips() { + # Run osmo-ggsn on 172.18.3.x (testenv0 bridge) instead of + # 127.0.0.1 (lo), so it works when running osmo-ggsn in QEMU to test + # kernel GTP-U too. We keep 127.0.0.x in the configs, so they can be + # used without testenv too. + sed -i 's/127\.0\.0\./172.18.3./g' "$1" +} + adjust_osmo_ggsn_config() { osmo-config-merge \ osmo-ggsn/osmo-ggsn.src.cfg \ osmo-ggsn/osmo-ggsn-"$CONFIG".confmerge \ > osmo-ggsn.cfg + + replace_ips osmo-ggsn.cfg } adjust_ttcn3_config() { @@ -34,6 +44,8 @@ sed -i "s/^GGSN_Tests.m_ggsn_conf := .*/GGSN_Tests.m_ggsn_conf := GGSN_CONF_$config_upper/" \ ../testsuite/GGSN_Tests.cfg + + replace_ips ../testsuite/GGSN_Tests.cfg } setcap_osmo_ggsn() { @@ -52,7 +64,7 @@ # Add a bridge reachable through the GTP tunnel that can answer ICMP # pings (for e.g. TC_pdp4_act_deact_gtpu_access). The bridge is also used to # connect the SUT when it runs in QEMU. -EXTRA_IPS="172.18.3.201 fd02:db8:3::201" add_remove_testenv0_bridge.sh +EXTRA_IPS="172.18.3.201 fd02:db8:3::201 172.18.3.2" add_remove_testenv0_bridge.sh case "$TESTENV_CLEAN_REASON" in prepare) -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38341?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ib768603b0050fe62baff39cab982a850eb91f49a Gerrit-Change-Number: 38341 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[L] Change in osmo-ttcn3-hacks[master]: testenv: support running SUT in QEMU
by osmith 10 Oct '24

10 Oct '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38343?usp=email ) Change subject: testenv: support running SUT in QEMU ...................................................................... testenv: support running SUT in QEMU Add two new arguments -C|--custom-kernel and -D|--debian-kernel. If any of these is set, pass an environment variable TESTENV_QEMU_KERNEL with the path to the kernel when running commands from testenv.cfg. These commands can then source the new qemu_functions.sh and use it to build an initramfs with the SUT and depending libraries on the fly, and start up QEMU to boot right to starting the SUT. All of that takes about ~1s on my system with kvm. Without kvm ~5s. A follow-up patch will adjust the ggsn testenv configs to optionally run osmo-ggsn in QEMU for testing kernel GTP-U. These scripts are based on scripts/kernel-tests from docker-playground. Related: osmo-ci Id64a1a778fa38eec20498c36b390332f75d7d3f5 Change-Id: Ic9cb7092fd029b7ba530fc755b5d4d73a9d86350 --- M .gitignore M _testenv/README.md M _testenv/data/podman/Dockerfile A _testenv/data/scripts/qemu/qemu_functions.sh A _testenv/data/scripts/qemu/qemu_ifup.sh A _testenv/data/scripts/qemu/qemu_init.sh A _testenv/data/scripts/qemu/qemu_wait.sh M _testenv/testenv/__init__.py M _testenv/testenv/cmd.py M _testenv/testenv/podman.py M _testenv/testenv/requirements.py M _testenv/testenv/testenv_cfg.py 12 files changed, 400 insertions(+), 1 deletion(-) Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 241a1d2..94061e3 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ sms.db-wal __pycache__ tags +.linux diff --git a/_testenv/README.md b/_testenv/README.md index 7db3e24..3fed9c9 100644 --- a/_testenv/README.md +++ b/_testenv/README.md @@ -20,6 +20,24 @@ Additional packages get installed after starting the container, with a package cache mounted to avoid unnecessary downloads. +### QEMU + +For SUTs that interact with kernel drivers, it is desirable to run them with a +separate kernel in QEMU. This can be enabled by running `./testenv.py run` with +the `-D` (Debian kernel) or `-C` (custom kernel) arguments. See the `ggsn` +testsuite for reference. + +#### Custom kernel + +When using `-C`, testenv uses a `.linux` file in the `osmo-ttcn3-hacks` dir as +kernel. You can download a pre-built kernel from jenkins: + +$ wget -O .linux "https://jenkins.osmocom.org/jenkins/job/build-kernel-torvalds/lastSuccessfu…" +$ wget -O .linux "https://jenkins.osmocom.org/jenkins/job/build-kernel-net-next/lastSuccessfu…" + +Or build your own kernel, see: +https://gitea.osmocom.org/osmocom/osmo-ci/src/branch/master/scripts/kernel + ## testenv.cfg The `testenv.cfg` file has one `[testsuite]` section, typically with one or @@ -98,6 +116,11 @@ * `vty_host=`: optionally set the VTY host for the SUT component to be used when obtaining a talloc report. If this is not set, `127.0.0.1` is used. +* `qemu=`: set to `optional` to allow running this test component in QEMU. + Additional logic must be added to build an initrd with the test component and + actually run it in QEMU, this is done by sourcing `qemu_functions.sh` and + using functions from there. See the `ggsn` testsuite for reference. + ### Executables #### $PATH @@ -108,6 +131,7 @@ * The directory of the testsuite * The directory for binaries built from source * The directory `_testenv/data/scripts` (which has e.g. `respawn.sh`) +* The directory `_testenv/data/scripts/qemu` #### $PWD (current working dir) @@ -180,6 +204,11 @@ files. Jenkins sets this to `esc` instead of `esc256` for better contrast on white background. +* `TESTENV_NO_KVM`: + Do not mount /dev/kvm in podman. This is used in jenkins where /dev/kvm is + available but doesn't work in podman. QEMU runs a bit slower when this is + set. + ## Troubleshooting ### Timeout waiting for RESET-ACK after sending RESET diff --git a/_testenv/data/podman/Dockerfile b/_testenv/data/podman/Dockerfile index 13412a2..6f6c739 100644 --- a/_testenv/data/podman/Dockerfile +++ b/_testenv/data/podman/Dockerfile @@ -12,20 +12,29 @@ # Install packages from Debian repositories (alphabetic order) ENV DEBIAN_FRONTEND=noninteractive RUN set -x && \ + mkdir -p /etc/kernel/postinst.d && \ + touch /etc/kernel/postinst.d/initramfs-tools && \ apt-get update && \ - apt-get install -y --no-install-recommends \ + apt-get install \ + -y \ + --no-install-recommends \ + -o Dpkg::Options::="--force-confold" \ autoconf \ automake \ + bc \ bison \ bridge-utils \ build-essential \ + busybox-static \ ca-certificates \ ccache \ cmake \ + cpio \ erlang-nox \ flex \ gdb \ git \ + gzip \ iproute2 \ iputils-ping \ libbson-dev \ @@ -34,6 +43,8 @@ libcurl4-gnutls-dev \ libdbd-sqlite3 \ libdbi-dev \ + libelf-dev \ + libgcc-11-dev \ libgcrypt-dev \ libgnutls28-dev \ libidn11-dev \ @@ -57,13 +68,16 @@ libusb-1.0-0-dev \ libyaml-dev \ libzmq3-dev \ + linux-image-amd64 \ meson \ netcat-openbsd \ + pax-utils \ pcscd \ pkg-config \ procps \ psmisc \ python3-pip \ + qemu-system-x86 \ rsync \ source-highlight \ sqlite3 \ diff --git a/_testenv/data/scripts/qemu/qemu_functions.sh b/_testenv/data/scripts/qemu/qemu_functions.sh new file mode 100755 index 0000000..c0dd8cc --- /dev/null +++ b/_testenv/data/scripts/qemu/qemu_functions.sh @@ -0,0 +1,191 @@ +#!/bin/sh -ex +INITRD_DIR="$PWD/_initrd" + +# Add one or more files to the initramfs, with parent directories. +# usr-merge: resolve symlinks for /lib -> /usr/lib etc. so "cp --parents" does +# not fail with "cp: cannot make directory '/tmp/initrd/lib': File exists" +# $@: path to files +qemu_initrd_add_file() { + local i + + for i in "$@"; do + case "$i" in + /bin/*|/sbin/*|/lib/*|/lib64/*) + cp -a --parents "$i" "$INITRD_DIR"/usr + ;; + *) + cp -a --parents "$i" "$INITRD_DIR" + ;; + esac + done +} + +# Add kernel module files with dependencies +# $@: kernel module names +qemu_initrd_add_mod() { + if [ "$TESTENV_QEMU_KERNEL" != "debian" ]; then + # Assume all drivers are statically built into the kernel, when + # using a custom kernel + return + fi + + local kernel="$(basename /lib/modules/*)" + local files="$(modprobe \ + -a \ + --dry-run \ + --show-depends \ + --set-version="$kernel" \ + "$@" \ + | sort -u \ + | cut -d ' ' -f 2)" + + qemu_initrd_add_file $files + + # Save the list of modules + for i in $@; do + echo "$i" >> "$INITRD_DIR"/modules + done +} + +# Add binaries with depending libraries +# $@: paths to binaries +qemu_initrd_add_bin() { + local bin + local bin_path + local file + + for bin in "$@"; do + local bin_path="$(which "$bin")" + if [ -z "$bin_path" ]; then + echo "ERROR: file not found: $bin" + exit 1 + fi + + lddtree_out="$(lddtree -l "$bin_path")" + if [ -z "$lddtree_out" ]; then + echo "ERROR: lddtree failed on '$bin_path'" + exit 1 + fi + + for file in $lddtree_out; do + qemu_initrd_add_file "$file" + + # Copy resolved symlink + if [ -L "$file" ]; then + qemu_initrd_add_file "$(realpath "$file")" + fi + done + done +} + +# Add command to run inside the initramfs +# $@: commands +qemu_initrd_add_cmd() { + local i + + if ! [ -e "$INITRD_DIR"/cmd.sh ]; then + echo "#!/bin/sh -ex" > "$INITRD_DIR"/cmd.sh + chmod +x "$INITRD_DIR"/cmd.sh + fi + + for i in "$@"; do + echo "$i" >> "$INITRD_DIR"/cmd.sh + done +} + +qemu_initrd_init() { + mkdir "$INITRD_DIR" + + for dir in bin sbin lib lib64; do + ln -s usr/"$dir" "$INITRD_DIR"/"$dir" + done + + mkdir -p \ + "$INITRD_DIR"/dev/net \ + "$INITRD_DIR"/proc \ + "$INITRD_DIR"/sys \ + "$INITRD_DIR"/tmp \ + "$INITRD_DIR"/usr/bin \ + "$INITRD_DIR"/usr/sbin + + qemu_initrd_add_bin \ + busybox + + qemu_initrd_add_cmd \ + "export PATH='$PATH:\$PATH'" + + if [ "$TESTENV_QEMU_KERNEL" = "debian" ]; then + qemu_initrd_add_mod \ + virtio_net \ + virtio_pci + + qemu_initrd_add_file \ + /lib/modules/*/modules.dep + fi +} + +qemu_initrd_finish() { + cp "$TESTENV_QEMU_SCRIPTS"/qemu_init.sh "$INITRD_DIR"/init + + tree -a "$INITRD_DIR" + + ( cd "$INITRD_DIR"; find . -print0 \ + | cpio --quiet -o -0 -H newc \ + | gzip -1 > "$INITRD_DIR".gz ) +} + +qemu_initrd_exit_error() { + # Building the initrd is quite verbose, therefore put it in a log file + # and only output its contents on error (see e.g. osmo-ggsn/run.sh) + cat "$1" + set +x + echo + echo "ERROR: failed to build the initrd!" + echo + exit 1 +} + +qemu_random_mac() { + printf "52:54:" + date "+%c %N" | sha1sum | sed 's/\(.\{2\}\)/\1:/g' | cut -d: -f 1-4 +} + +qemu_run() { + local machine_arg + local kernel="$TESTENV_QEMU_KERNEL" + local kernel_cmdline=" + root=/dev/ram0 + console=ttyS0 + panic=-1 + init=/init + loglevel=8 + " + + if [ "$kernel" = "debian" ]; then + kernel="$(ls -1 /boot/vmlinuz*)" + fi + + if [ -e /dev/kvm ]; then + machine_arg="-machine pc,accel=kvm" + else + machine_arg="-machine pc" + fi + + # sudo is required to set up networking in qemu_ifup.sh + # </dev/null to deatch stdin, so qemu doesn't capture ^C + sudo sh -c " + qemu-system-x86_64 \ + $machine_arg \ + -smp 1 \ + -m 512M \ + -no-user-config -nodefaults -display none \ + -no-reboot \ + -kernel '$kernel' \ + -initrd '$INITRD_DIR.gz' \ + -append '$kernel_cmdline' \ + -serial stdio \ + -netdev 'tap,id=nettest,script=$TESTENV_QEMU_SCRIPTS/qemu_ifup.sh' \ + -device 'virtio-net-pci,netdev=nettest,mac=$(qemu_random_mac)' \ + </dev/null + " +} diff --git a/_testenv/data/scripts/qemu/qemu_ifup.sh b/_testenv/data/scripts/qemu/qemu_ifup.sh new file mode 100755 index 0000000..370bea5 --- /dev/null +++ b/_testenv/data/scripts/qemu/qemu_ifup.sh @@ -0,0 +1,10 @@ +#!/bin/sh -e +br="testenv0" +qemu_if="$1" + +echo "qemu_ifup.sh: $br, $qemu_if" +set -x + +ip link set "$qemu_if" up + +brctl addif "$br" "$qemu_if" diff --git a/_testenv/data/scripts/qemu/qemu_init.sh b/_testenv/data/scripts/qemu/qemu_init.sh new file mode 100755 index 0000000..1c8b39b --- /dev/null +++ b/_testenv/data/scripts/qemu/qemu_init.sh @@ -0,0 +1,36 @@ +#!/bin/busybox sh +echo "Running initrd-init.sh" +set -ex + +export HOME=/root +export LD_LIBRARY_PATH=/usr/local/lib +export PATH=/usr/local/bin:/usr/bin:/bin:/sbin:/usr/local/sbin:/usr/sbin +export TERM=screen + +/bin/busybox --install -s + +mknod /dev/null c 1 3 + +# Required for osmo-ggsn +mknod /dev/net/tun c 10 200 + +hostname qemu + +mount -t proc proc /proc +mount -t sysfs sys /sys + +# Load modules from qemu_initrd_add_mod() +if [ -e /modules ]; then + cat /modules | xargs -t -n1 modprobe +fi + +ip link set lo up +ip link set eth0 up + +echo "KERNEL_TEST_VM_IS_READY" + +# Use '|| true' to avoid "attempting to kill init" kernel panic on failure +/cmd.sh || true + +# Avoid kernel panic when init exits +poweroff -f diff --git a/_testenv/data/scripts/qemu/qemu_wait.sh b/_testenv/data/scripts/qemu/qemu_wait.sh new file mode 100755 index 0000000..fb45c7e --- /dev/null +++ b/_testenv/data/scripts/qemu/qemu_wait.sh @@ -0,0 +1,22 @@ +#!/bin/sh -e +if [ -z "$TESTENV_QEMU_KERNEL" ]; then + exit 0 +fi + +LOGFILE="$(basename "$PWD").log" + +i=0 +for i in $(seq 1 600); do + sleep 0.1 + if grep -q KERNEL_TEST_VM_IS_READY "$LOGFILE"; then + # Wait some more for SUT to become ready + sleep 1 + exit 0 + fi +done + +echo +echo "ERROR: Timeout while waiting for QEMU to become ready" +echo + +exit 1 diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py index 2af83ed..eb687f3 100644 --- a/_testenv/testenv/__init__.py +++ b/_testenv/testenv/__init__.py @@ -13,6 +13,7 @@ src_dir = os.environ.get("TESTENV_SRC_DIR", os.path.realpath(f"{__file__}/../../../..")) data_dir = os.path.join(os.path.realpath(f"{__file__}/../.."), "data") +custom_kernel_path = os.path.join(os.path.realpath(f"{__file__}/../../.."), ".linux") distro_default = "debian:bookworm" cache_dir_default = os.path.join(os.path.expanduser("~/.cache"), "osmo-ttcn3-testenv") ccache_dir_default = os.path.join(cache_dir_default, "ccache") @@ -91,6 +92,29 @@ metavar="OBS_PROJECT", help="use binary packages from this Osmocom OBS project instead (e.g. osmocom:nightly)", ) + + group = sub_run.add_argument_group( + "QEMU options", + "For some tests, the SUT can or must run in QEMU, typically to use kernel GTP-U.", + ) + group = group.add_mutually_exclusive_group() + group.add_argument( + "-D", + "--debian-kernel", + action="store_const", + dest="kernel", + const="debian", + help="run SUT in QEMU with debian kernel", + ) + group.add_argument( + "-C", + "--custom-kernel", + action="store_const", + dest="kernel", + const="custom", + help=f"run SUT in QEMU with custom kernel ({custom_kernel_path})", + ) + group = sub_run.add_argument_group( "config file options", "Testsuite and test component configs" @@ -159,6 +183,15 @@ if args.binary_repo and not args.podman: raise NoTraceException("--binary-repo requires --podman") + if args.kernel == "debian" and not args.podman: + raise NoTraceException("--kernel-debian requires --podman") + + if args.kernel == "custom" and not os.path.exists(custom_kernel_path): + logging.critical( + "See _testenv/README.md for more information on downloading a pre-built kernel or building your own kernel." + ) + raise NoTraceException(f"For --kernel-custom, put a symlink or copy of your kernel to: {custom_kernel_path}") + ttcn3_hacks_dir_src = os.path.realpath(f"{__file__}/../../..") testsuite_dir = os.path.join(ttcn3_hacks_dir_src, args.testsuite) if not os.path.exists(testsuite_dir): diff --git a/_testenv/testenv/cmd.py b/_testenv/testenv/cmd.py index 6f502fc..5e651bd 100644 --- a/_testenv/testenv/cmd.py +++ b/_testenv/testenv/cmd.py @@ -49,6 +49,13 @@ else: env_extra["OSMO_DEV_MAKE_DIR"] = os.path.join(testenv.args.cache, "host", "make") + if testenv.args.kernel == "debian": + env_extra["TESTENV_QEMU_KERNEL"] = "debian" + elif testenv.args.kernel == "custom": + env_extra["TESTENV_QEMU_KERNEL"] = testenv.custom_kernel_path + if testenv.args.kernel: + env_extra["TESTENV_QEMU_SCRIPTS"] = os.path.join(testenv.data_dir, "scripts/qemu") + def exit_error_cmd(completed, error_msg): """:param completed: return from run_cmd() below""" @@ -62,6 +69,7 @@ def generate_env(env={}, podman=False): ret = dict(env_extra) path = os.path.join(testenv.data_dir, "scripts") + path += f":{os.path.join(testenv.data_dir, 'scripts/qemu')}" if testenv.testsuite.ttcn3_hacks_dir: path += f":{os.path.join(testenv.testsuite.ttcn3_hacks_dir, testenv.args.testsuite)}" diff --git a/_testenv/testenv/podman.py b/_testenv/testenv/podman.py index 60aecca..bd1e8d8 100644 --- a/_testenv/testenv/podman.py +++ b/_testenv/testenv/podman.py @@ -221,6 +221,13 @@ f"{osmo_dev_dir}:{osmo_dev_dir}", ] + if testenv.args.kernel: + if not os.environ.get("TESTENV_NO_KVM") and os.path.exists("/dev/kvm"): + cmd += ["--volume", "/dev/kvm:/dev/kvm"] + if os.path.islink(testenv.custom_kernel_path): + dest = os.readlink(testenv.custom_kernel_path) + cmd += ["--volume", "{dest}:{dest}:ro"] + cmd += [ "--volume", f"{testdir_topdir}:{testdir_topdir}", diff --git a/_testenv/testenv/requirements.py b/_testenv/testenv/requirements.py index 7c39a7c..4973f6e 100644 --- a/_testenv/testenv/requirements.py +++ b/_testenv/testenv/requirements.py @@ -36,6 +36,15 @@ "wget", ] + if testenv.args.kernel: + programs += [ + "busybox", + "cpio", + "gzip", + "lddtree", + "qemu-system-x86_64", + ] + abort = False for program in programs: if not shutil.which(program): diff --git a/_testenv/testenv/testenv_cfg.py b/_testenv/testenv/testenv_cfg.py index ba830a1..8bb4119 100644 --- a/_testenv/testenv/testenv_cfg.py +++ b/_testenv/testenv/testenv_cfg.py @@ -71,6 +71,39 @@ return host, port +def verify_qemu_cfgs(): + """Check if -C or -K is set, but any of the selected configs can't run with + QEMU.""" + if not testenv.args.kernel: + return + + for basename, cfg in cfgs.items(): + missing = True + + for section in cfg.keys(): + if "qemu" in cfg[section]: + missing = False + break + + if missing: + testsuite = testenv.args.testsuite + logging.critical(f"{testsuite}/{basename}: doesn't support running in QEMU") + exit_error_readme() + + +def verify_qemu_section(path, cfg, section): + """Verify that qemu= has proper values.""" + if "qemu" not in cfg[section]: + return + + valid = ["optional"] + value = cfg[section]["qemu"] + + if value not in valid: + logging.error(f"{path}: [{section}]: qemu={value} is invalid, must be one of: {valid}") + exit_error_readme() + + def verify(cfg, path): keys_valid_testsuite = [ "clean", @@ -85,6 +118,7 @@ "package", "prepare", "program", + "qemu", "setup", "vty_host", "vty_port", @@ -127,6 +161,8 @@ logging.error(msg) exit_error_readme() + verify_qemu_section(path, cfg, section) + if section not in ["DEFAULT", "testsuite"] and "make" not in cfg[section]: logging.error(f"{path}: missing make= in section [{section}].") logging.error("If this is on purpose, set make=no.") @@ -207,6 +243,7 @@ # No --config argument given, and there is only one testenv.cfg if not testenv.args.config: cfgs[basename] = cfg + verify_qemu_cfgs() return cfgs_all[basename] = cfg @@ -228,3 +265,5 @@ if not matched: raise_error_config_arg(config_paths, config_arg) + + verify_qemu_cfgs() -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38343?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ic9cb7092fd029b7ba530fc755b5d4d73a9d86350 Gerrit-Change-Number: 38343 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: ggsn: testenv: support running osmo-ggsn in QEMU
by osmith 10 Oct '24

10 Oct '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38344?usp=email ) Change subject: ggsn: testenv: support running osmo-ggsn in QEMU ...................................................................... ggsn: testenv: support running osmo-ggsn in QEMU Run osmo-ggsn optionally in QEMU, to test the kernel GTP-U feature with different kernels. Related: OS#3208 Change-Id: I3f9db4325d5928c809cc99bc82d9cb82bf9e71eb --- A ggsn_tests/osmo-ggsn/run.sh M ggsn_tests/osmo-ggsn/testenv.sh M ggsn_tests/testenv_osmo_ggsn_all.cfg M ggsn_tests/testenv_osmo_ggsn_v4_only.cfg M ggsn_tests/testenv_osmo_ggsn_v4v6_only.cfg M ggsn_tests/testenv_osmo_ggsn_v6_only.cfg 6 files changed, 74 insertions(+), 6 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve diff --git a/ggsn_tests/osmo-ggsn/run.sh b/ggsn_tests/osmo-ggsn/run.sh new file mode 100755 index 0000000..ae77484 --- /dev/null +++ b/ggsn_tests/osmo-ggsn/run.sh @@ -0,0 +1,40 @@ +#!/bin/sh -ex +if [ -z "$TESTENV_QEMU_KERNEL" ]; then + exec osmo-ggsn "$@" +fi + +build_initrd() { + qemu_initrd_init + + qemu_initrd_add_mod \ + gtp \ + tun + + qemu_initrd_add_bin \ + osmo-ggsn + + qemu_initrd_add_file \ + osmo-ggsn.cfg + + # Enable dynamic_debug + qemu_initrd_add_cmd \ + "mount -t debugfs none /sys/kernel/debug || true" \ + "echo -n 'module gtp +p' > /sys/kernel/debug/dynamic_debug/control || true" + + qemu_initrd_add_cmd \ + "ip addr add 172.18.3.2/24 brd 172.18.3.255 dev eth0" \ + "ip addr add 172.18.3.201/24 brd 172.18.3.255 dev eth0" \ + "ip route add default via 172.18.3.1 dev eth0" \ + "sysctl net.ipv4.ip_forward=1" \ + "osmo-ggsn" + + qemu_initrd_finish +} + +. qemu_functions.sh + +if ! build_initrd >build_initrd.log 2>&1; then + qemu_initrd_exit_error "build_initrd.log" +fi + +qemu_run diff --git a/ggsn_tests/osmo-ggsn/testenv.sh b/ggsn_tests/osmo-ggsn/testenv.sh index 4155d52..0c0bc37 100755 --- a/ggsn_tests/osmo-ggsn/testenv.sh +++ b/ggsn_tests/osmo-ggsn/testenv.sh @@ -22,6 +22,15 @@ esac } +check_usage_qemu() { + if [ -n "$TESTENV_QEMU_KERNEL" ] && [ "$CONFIG" = "all" ]; then + set +x + echo "ERROR: '--config osmo_ggsn_all' uses multiple APNs, which is currently not supported with kernel" \ + "gtp-u! (OS#6106)" + exit 1 + fi +} + replace_ips() { # Run osmo-ggsn on 172.18.3.x (testenv0 bridge) instead of # 127.0.0.1 (lo), so it works when running osmo-ggsn in QEMU to test @@ -37,6 +46,10 @@ > osmo-ggsn.cfg replace_ips osmo-ggsn.cfg + + if [ -n "$TESTENV_QEMU_KERNEL" ]; then + sed -i "s/gtpu-mode tun/gtpu-mode kernel-gtp/" osmo-ggsn.cfg + fi } adjust_ttcn3_config() { @@ -49,7 +62,9 @@ } setcap_osmo_ggsn() { - sudo setcap CAP_NET_ADMIN=+eip $(which osmo-ggsn) + if [ -z "$TESTENV_QEMU_KERNEL" ]; then + sudo setcap CAP_NET_ADMIN=+eip $(which osmo-ggsn) + fi } rename_junit_xml_classname() { @@ -64,10 +79,15 @@ # Add a bridge reachable through the GTP tunnel that can answer ICMP # pings (for e.g. TC_pdp4_act_deact_gtpu_access). The bridge is also used to # connect the SUT when it runs in QEMU. -EXTRA_IPS="172.18.3.201 fd02:db8:3::201 172.18.3.2" add_remove_testenv0_bridge.sh +if [ -n "$TESTENV_QEMU_KERNEL" ]; then + add_remove_testenv0_bridge.sh +else + EXTRA_IPS="172.18.3.201 fd02:db8:3::201 172.18.3.2" add_remove_testenv0_bridge.sh +fi case "$TESTENV_CLEAN_REASON" in prepare) + check_usage_qemu adjust_osmo_ggsn_config adjust_ttcn3_config setcap_osmo_ggsn diff --git a/ggsn_tests/testenv_osmo_ggsn_all.cfg b/ggsn_tests/testenv_osmo_ggsn_all.cfg index 4c33b43..c389064 100644 --- a/ggsn_tests/testenv_osmo_ggsn_all.cfg +++ b/ggsn_tests/testenv_osmo_ggsn_all.cfg @@ -3,7 +3,9 @@ config=GGSN_Tests.cfg [ggsn] -program=osmo-ggsn +qemu=optional +program=osmo-ggsn/run.sh +setup=qemu_wait.sh make=osmo-ggsn package=osmo-ggsn libosmocore-utils copy=osmo-ggsn diff --git a/ggsn_tests/testenv_osmo_ggsn_v4_only.cfg b/ggsn_tests/testenv_osmo_ggsn_v4_only.cfg index 57e736f..604864d 100644 --- a/ggsn_tests/testenv_osmo_ggsn_v4_only.cfg +++ b/ggsn_tests/testenv_osmo_ggsn_v4_only.cfg @@ -3,7 +3,9 @@ config=GGSN_Tests.cfg [ggsn] -program=osmo-ggsn +qemu=optional +program=osmo-ggsn/run.sh +setup=qemu_wait.sh make=osmo-ggsn package=osmo-ggsn libosmocore-utils copy=osmo-ggsn diff --git a/ggsn_tests/testenv_osmo_ggsn_v4v6_only.cfg b/ggsn_tests/testenv_osmo_ggsn_v4v6_only.cfg index 6f0e11f..b037c0c 100644 --- a/ggsn_tests/testenv_osmo_ggsn_v4v6_only.cfg +++ b/ggsn_tests/testenv_osmo_ggsn_v4v6_only.cfg @@ -3,7 +3,9 @@ config=GGSN_Tests.cfg [ggsn] -program=osmo-ggsn +qemu=optional +program=osmo-ggsn/run.sh +setup=qemu_wait.sh make=osmo-ggsn package=osmo-ggsn libosmocore-utils copy=osmo-ggsn diff --git a/ggsn_tests/testenv_osmo_ggsn_v6_only.cfg b/ggsn_tests/testenv_osmo_ggsn_v6_only.cfg index 101538f..fdaa395 100644 --- a/ggsn_tests/testenv_osmo_ggsn_v6_only.cfg +++ b/ggsn_tests/testenv_osmo_ggsn_v6_only.cfg @@ -3,7 +3,9 @@ config=GGSN_Tests.cfg [ggsn] -program=osmo-ggsn +qemu=optional +program=osmo-ggsn/run.sh +setup=qemu_wait.sh make=osmo-ggsn package=osmo-ggsn libosmocore-utils copy=osmo-ggsn -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38344?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I3f9db4325d5928c809cc99bc82d9cb82bf9e71eb Gerrit-Change-Number: 38344 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[L] Change in libosmo-sigtran[master]: ss7 vty: Fix insert order of routes with higher priority
by pespin 10 Oct '24

10 Oct '24
Attention is currently required from: fixeria, osmith. Hello Jenkins Builder, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38375?usp=email to look at the new patch set (#4). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: ss7 vty: Fix insert order of routes with higher priority ...................................................................... ss7 vty: Fix insert order of routes with higher priority Route lookup ((hmrt_message_for_routing() => osmo_ss7_route_lookup() => osmo_ss7_route_find_dpc_mask())) iterates the list of routes assuming they are ordered by mask length (so it doesn't need to iterate the full list every time). Similary, it implicitly seems to assume that the entries are also sorted by priority. However, priority is not currently taken into account when being inserted in the routing table, so the route ends up in the incorrect place. The VTY "update route" command used to first insert the route and only *after* that tweak some of its fields, like priority or qos-class. This commit adds a new set of osmo_ss7_route API which allows users to *first* allocate a route and configure it completelly, and *second* insert it once it contains all the information. This way, the insert algorithm can take into account the configured route priority and place the route entry in the routing table at the proper place. Related: SYS#7112 Change-Id: I6e7b5e3f06ae2c9468da58c55d2f42cbcd777218 --- M TODO-RELEASE M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c M src/osmo_ss7_vty.c M tests/vty/osmo_stp_route_prio.vty 5 files changed, 200 insertions(+), 56 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/75/38375/4 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38375?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I6e7b5e3f06ae2c9468da58c55d2f42cbcd777218 Gerrit-Change-Number: 38375 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • ...
  • 164
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.