Attention is currently required from: laforge.
dexter has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/pysim/+/38255?usp=email )
Change subject: pySim-shell: New '-e' command line argument
......................................................................
Patch Set 1:
(1 comment)
File pySim-shell.py:
https://gerrit.osmocom.org/c/pysim/+/38255/comment/80b8492b_253b1912?usp=em… :
PS1, Line 1128: for c in opts.execute_command:
> I gave it a quick try, for some reason I get: […]
I think when -e is not used opts.execute_command is none, then the for refuses to iterate.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/38255?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I74004f46105553f077c039ca0f86f75afccc7342
Gerrit-Change-Number: 38255
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: dexter <pmaier(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Mon, 23 Sep 2024 10:07:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: laforge.
dexter has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/pysim/+/38255?usp=email )
Change subject: pySim-shell: New '-e' command line argument
......................................................................
Patch Set 1:
(2 comments)
Patchset:
PS1:
I think this is very useful.
File pySim-shell.py:
https://gerrit.osmocom.org/c/pysim/+/38255/comment/d9acbe67_cd57baba?usp=em… :
PS1, Line 1128: for c in opts.execute_command:
I gave it a quick try, for some reason I get:
TypeError: 'NoneType' object is not iterable
when there is no -e option used.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/38255?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I74004f46105553f077c039ca0f86f75afccc7342
Gerrit-Change-Number: 38255
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: dexter <pmaier(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Mon, 23 Sep 2024 10:05:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38261?usp=email )
Change subject: testenv: clean_run_scripts: skip if podman stopped
......................................................................
testenv: clean_run_scripts: skip if podman stopped
Do not attempt to run the clean_run_scripts, if podman is being used and
the container has already been shutdown.
Change-Id: I3cc05aabd97b73b65c3089e8806f7a9b32e5975c
---
M _testenv/README.md
M _testenv/testenv/testdir.py
2 files changed, 12 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/61/38261/1
diff --git a/_testenv/README.md b/_testenv/README.md
index 983692c..09b12e8 100644
--- a/_testenv/README.md
+++ b/_testenv/README.md
@@ -57,7 +57,8 @@
collisions when running a test with multiple configs
(`rename_junit_xml_classname.sh`). See below for `PATH` and `PWD`. A
`TESTENV_CLEAN_REASON` env var is set to `prepare`, `crashed` or `finished`
- depending on when the script runs.
+ depending on when the script runs. The script will not run on crash if podman
+ is used, as the container gets shutdown beforehand.
#### Component section
diff --git a/_testenv/testenv/testdir.py b/_testenv/testenv/testdir.py
index 242d17d..55f04d2 100644
--- a/_testenv/testenv/testdir.py
+++ b/_testenv/testenv/testdir.py
@@ -170,8 +170,14 @@
def clean_run_scripts(reason="crashed"):
global clean_scripts
- for section, script in clean_scripts.items():
- logging.info(f"Running {section} clean script (reason: {reason})")
- env = {"TESTENV_CLEAN_REASON": reason}
- testenv.cmd.run(script, cwd=os.path.join(testdir, section), env=env)
+ if not clean_scripts:
+ return
+ elif testenv.args.podman and not testenv.podman.is_running():
+ logging.debug("Skipping clean up scripts, podman container has already stopped")
+ else:
+ for section, script in clean_scripts.items():
+ logging.info(f"Running {section} clean script (reason: {reason})")
+ env = {"TESTENV_CLEAN_REASON": reason}
+ testenv.cmd.run(script, cwd=os.path.join(testdir, section), env=env)
+
clean_scripts = {}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38261?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3cc05aabd97b73b65c3089e8806f7a9b32e5975c
Gerrit-Change-Number: 38261
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38259?usp=email )
Change subject: testenv/README: deduplicate clean= description
......................................................................
testenv/README: deduplicate clean= description
Change-Id: I12dc9adb508a409a6156f9682c9db5684f551b06
---
M _testenv/README.md
1 file changed, 3 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/59/38259/1
diff --git a/_testenv/README.md b/_testenv/README.md
index 2c70a0a..82903a1 100644
--- a/_testenv/README.md
+++ b/_testenv/README.md
@@ -85,11 +85,9 @@
This can be used to wait until the program is ready or to fill a test
database for example. See below for `PATH`.
-* `clean=`: optional script to run before `prepare=` and on exit. This can be
- used to clean up network devices for example, or to fix name collisions when
- running a test with multiple configs (`rename_junit_xml_classname.sh`). See
- below for `PATH`. A `TESTENV_CLEAN_REASON` env var is set to `prepare`,
- `crashed` or `finished` depending on when the script runs.
+* `clean=`: same as in the Testsuite section above, but runs at a slightly
+ different time: before/after/on crash of the program instead of the
+ testsuite.
* `vty_port=`: optionally set the VTY port for the SUT component to obtain a
talloc report after each test case has been executed. If this is not set, no
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38259?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I12dc9adb508a409a6156f9682c9db5684f551b06
Gerrit-Change-Number: 38259
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38260?usp=email )
Change subject: testenv/README: document current working dir
......................................................................
testenv/README: document current working dir
Change-Id: I218507bcbec94a36976fbf57d12ffd083fd2acfb
---
M _testenv/README.md
1 file changed, 23 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/38260/1
diff --git a/_testenv/README.md b/_testenv/README.md
index 82903a1..983692c 100644
--- a/_testenv/README.md
+++ b/_testenv/README.md
@@ -55,14 +55,14 @@
* `clean=`: optional script to run before running the testsuite and on exit.
This can be used to clean up network devices for example, or to fix name
collisions when running a test with multiple configs
- (`rename_junit_xml_classname.sh`). See below for `PATH`. A
+ (`rename_junit_xml_classname.sh`). See below for `PATH` and `PWD`. A
`TESTENV_CLEAN_REASON` env var is set to `prepare`, `crashed` or `finished`
depending on when the script runs.
#### Component section
* `program=`: executable for starting a test component, may contain arguments.
- See below for `PATH`.
+ See below for `PATH` and `PWD`.
* `copy=`: file(s) to copy from the testsuite directory to the test directory,
like `.cfg` and `.confmerge` files. Multiple values are separated by spaces.
@@ -78,12 +78,12 @@
* `prepare=`: optional script to run before staring the program (after files
are copied to the test directory). Typically this is used to create configs
- with `osmo-config-merge`. See below for `PATH`.
+ with `osmo-config-merge`. See below for `PATH` and `PWD`.
* `setup=`: optional script to run after the program was started. Execution of
the next program / the testsuite will wait until the setup script has quit.
This can be used to wait until the program is ready or to fill a test
- database for example. See below for `PATH`.
+ database for example. See below for `PATH` and `PWD`.
* `clean=`: same as in the Testsuite section above, but runs at a slightly
different time: before/after/on crash of the program instead of the
@@ -96,7 +96,9 @@
* `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.
-### PATH
+### Executables
+
+#### $PATH
Executables mentioned in `program=`, `prepare=`, `setup=` and `clean=` run
with a `PATH` environment variable containing:
@@ -105,6 +107,22 @@
* The directory for binaries built from source
* The directory `_testenv/data/scripts` (which has e.g. `respawn.sh`)
+#### $PWD (current working dir)
+
+The executables run inside a directory with the component name, inside the log
+dir. For example:
+
+```
+/tmp/logs
+├── ggsn # Executables from [ggsn] section run in this dir
+│ ├── ggsn.log
+│ └── osmo-ggsn.cfg
+└── testsuite # Executables from [testsuite] run in this dir
+ ├── Common.cfg
+ ├── GGSN_Tests.cfg
+ └── GGSN_Tests.default
+```
+
### Latest configs
Sometimes we need to run test components and/or testsuites with different
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38260?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I218507bcbec94a36976fbf57d12ffd083fd2acfb
Gerrit-Change-Number: 38260
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38264?usp=email )
Change subject: ggsn: f_wait_icmp4: ignore ICMPv4 redirect
......................................................................
ggsn: f_wait_icmp4: ignore ICMPv4 redirect
In the test TC_pdp4_clients_interact_with_txseq, the testsuite opens two
PDP contexts and sends a ping (ICMP echo request) from the first context
to the second, then waits with f_wait_icmp4 until the ping arrives at
the second PDP context.
When running the test with testenv and podman, an additional ICMP
redirect packet arrives, before the ICMP echo request arrives. The
redirect packet has the TEID of the first PDP context, and so
f_wait_icmp4 fails if we don't ignore this redirect packet.
Adjust f_wait_icmp4 to ignore such redirect packets.
Change-Id: I6dff4db1fb0803a02f412ff23bb5dcac8e50a504
---
M ggsn_tests/GGSN_Tests.ttcn
M library/ICMP_Templates.ttcn
2 files changed, 22 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/64/38264/1
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index c151346..6437f89 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -884,6 +884,16 @@
}
}
[] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud {
+ var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data;
+ var IPv4_packet ip4 := f_IPv4_dec(gpdu);
+ if (ip4.header.ver != 4) {
+ repeat;
+ }
+ var PDU_ICMP icmp4 := f_dec_PDU_ICMP(ip4.payload);
+ if (match(icmp4, tr_ICMPv4_RE)) {
+ log("Received ICMPv4 redirect, ignoring");
+ repeat;
+ }
setverdict(fail, "Received wrong local TEID");
}
[] GTPU.receive { setverdict(fail); }
diff --git a/library/ICMP_Templates.ttcn b/library/ICMP_Templates.ttcn
index cf88e93..892e4e2 100644
--- a/library/ICMP_Templates.ttcn
+++ b/library/ICMP_Templates.ttcn
@@ -50,6 +50,17 @@
}
}
+ /* template for receiving/matching an ICMPv4 redirect */
+ template (present) PDU_ICMP tr_ICMPv4_RE := {
+ redirect := {
+ type_field := 5,
+ code := ?,
+ checksum := ?,
+ gateway_internet_address := ?,
+ original_ip_msg := ?
+ }
+ }
+
/* template for receiving/matching an ICMPv6 Destination Unreachable */
template (present) PDU_ICMP tr_ICMPv4_DU := {
destination_unreachable := {
@@ -93,4 +104,4 @@
data[11] := cksum[1];
return data;
}
-}
\ No newline at end of file
+}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38264?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6dff4db1fb0803a02f412ff23bb5dcac8e50a504
Gerrit-Change-Number: 38264
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38262?usp=email )
Change subject: testenv: copy=: support copying directories too
......................................................................
testenv: copy=: support copying directories too
In preparation for adding the inital testenv.cfgs for ggsn, allow
copying full directories with copy= too. This will make the ggsn
testenv.cfg files easier to maintain.
Change-Id: I8e680fbd93516030614c015d7c3b5bdb153ec487
---
M _testenv/README.md
M _testenv/testenv/testdir.py
2 files changed, 16 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/62/38262/1
diff --git a/_testenv/README.md b/_testenv/README.md
index 09b12e8..7db3e24 100644
--- a/_testenv/README.md
+++ b/_testenv/README.md
@@ -65,8 +65,9 @@
* `program=`: executable for starting a test component, may contain arguments.
See below for `PATH` and `PWD`.
-* `copy=`: file(s) to copy from the testsuite directory to the test directory,
- like `.cfg` and `.confmerge` files. Multiple values are separated by spaces.
+* `copy=`: optionally copy a space separated list of files or directories from
+ the testsuite directory to the test directory, like `.cfg` and `.confmerge`
+ files.
* `make=`: osmo-dev make target for building from source, if running without
`--binary-repo`. This is usually the name of the git repository, but could
diff --git a/_testenv/testenv/testdir.py b/_testenv/testenv/testdir.py
index 55f04d2..ee698fff 100644
--- a/_testenv/testenv/testdir.py
+++ b/_testenv/testenv/testdir.py
@@ -80,11 +80,19 @@
testenv.cmd.run(["install", "-Dm644", path, path_dest])
if "copy" in section_data:
- for file in section_data["copy"].split(" "):
- path = os.path.join(testsuite_dir, file)
- path_dest = os.path.join(section_dir, file)
- mode = 755 if os.access(path, os.X_OK) else 644
- testenv.cmd.run(["install", f"-Dm{mode}", path, path_dest])
+ for copy_entry in section_data["copy"].split(" "):
+ path = os.path.join(testsuite_dir, copy_entry)
+ if os.path.isdir(path):
+ pattern = os.path.join(path, "**")
+ paths = glob.glob(pattern, recursive=True)
+ else:
+ paths = [path]
+ for path in paths:
+ if os.path.isdir(path):
+ continue
+ path_dest = os.path.join(section_dir, os.path.relpath(path, testsuite_dir))
+ mode = 755 if os.access(path, os.X_OK) else 644
+ testenv.cmd.run(["install", f"-Dm{mode}", path, path_dest])
if "clean" in section_data:
logging.info(f"Running {section} clean script (reason: prepare)")
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38262?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I8e680fbd93516030614c015d7c3b5bdb153ec487
Gerrit-Change-Number: 38262
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>