Commit Graph

24 Commits

Author SHA1 Message Date
Oliver Smith 5a48bfbe24 scripts/kernel-test: build initrd+kernel as user
Refactor code to build the initramfs and kernel as user, instead of
running related code as root. Put the smoke_test.log into /tmp instead
of the cache dir, so we don't write as root into the cache dir. We cat
it on error anyway, so we don't need to have it in the workspace.

Change-Id: I1670dd86f2670f42eb99e4527d483965d8222402
2024-04-03 12:41:11 +00:00
Oliver Smith 10e6a00476 scripts/kernel-test: put mknod commands in init.sh
Prepare to run the preparation without root rights.

Change-Id: I07648f058ca55515ffc7396598147a03dcfe7976
2024-04-03 12:41:11 +00:00
Oliver Smith c1056236b5 kernel-test/kernel-build: update net-next branch
The branch of net-next is now called main. Update the default
KERNEL_BRANCH to main, as the default KERNEL_URL points to net-next.git.

Related: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/
Change-Id: Ic4b13c3cbc0933db9d520e6d737c45b6b08e8c48
2024-04-03 12:41:11 +00:00
Oliver Smith ad154fc565 scripts/kernel-test: do shallow fetch
Instead of fetching the entire history, only fetch the most recent
commit.

Change-Id: I92d90c1451ff6abff2df3b1318b5194880e77f2e
2024-04-03 12:41:11 +00:00
Oliver Smith f2786e8573 ttcn3-ggsn-test: enable dynamic debug
Enable loglevel=8, as otherwise the messages do not show up.

Change-Id: I048646c4f90233939809546d30c94c4218eedbb1
2024-03-04 09:31:34 +01:00
Oliver Smith 5494300e60 scripts/kernel-test: add /dev/null
Some busybox programs need /dev/null, add it to the initramfs.

Change-Id: Ie583ae816b517c10d13d77aa45155fc4d1209c26
2024-03-04 07:50:38 +00:00
Oliver Smith 9500c29ce6 scripts/kernel-test: add KERNEL_SKIP_SMOKE_TEST
Speed up local test cycles by not running the smoke test every time.

Change-Id: I505b74e8c9b221655a97c5464f6fe4f21204a894
2023-07-21 11:28:33 +00:00
Oliver Smith c53a630c19 scripts/kernel-test: add KERNEL_SKIP_REBUILD
Speed up local test cycles by not building the kernel again from source
if not needed.

Change-Id: Iaa401918d7c09ec92ec546071d8961e99a4cbb47
2023-07-21 11:28:33 +00:00
Oliver Smith cb707e83c8 scripts/kernel-test: fixup for initrd_add_file
The previous versions happened to work too in my testing with
osmo-ggsn. Use the correct loop variable.

Fixes: 0660fc4e ("scripts/kernel-test: adjust to usr-merge")
Change-Id: I0c0ca91116a8cd156b185bb53512371bbcb76515
2023-07-18 14:24:40 +02:00
Oliver Smith 29bd71264d scripts/kernel-test/run-qemu: update qemu args
Fix these warnings:

warning: short-form boolean option 'server' deprecated
warning: short-form boolean option 'nowait' deprecated

Change-Id: Iba84d8e61c2d9cbd687d803066db0c04aca9f805
2023-07-18 14:14:36 +02:00
Oliver Smith 90e48a63e0 scripts/kernel-test/run-qemu: set init=/init
Set init= so the kernel doesn't try to run other scripts if /init
fails:

[    2.946381] Run /init as init process
[    2.948885] Failed to execute /init (error -2)
[    2.949051] Run /sbin/init as init process
[    2.949329] Run /etc/init as init process
[    2.949566] Run /bin/init as init process
[    2.949795] Run /bin/sh as init process

Change-Id: I063c7625acaa15130d8361d4e944c3773c9b37c4
2023-07-18 14:14:36 +02:00
Oliver Smith 0660fc4e4b scripts/kernel-test: adjust to usr-merge
In debian bookworm, the /usr merge has been implemented:

  /bin → /usr/bin
  /sbin → /usr/sbin
  /lib → /usr/lib
  /lib64 → /usr/lib64

The initramfs filesystem layout is derived from the paths of the
binaries and libraries in the full system. Create the same symlinks and
adjust initrd_add_bin so it does not trip over the symlinks.

I've also considered to change all input for initrd_add_bin to point at
the /usr/… paths. But this is not possible, for example ldd/lddtree will
point at libraries in /lib and /lib64, and this gets passed to
initrd_add_bin.

Without this patch, the init script and all binaries called from it
cannot be executed.

Related: OS#6057
Related: https://wiki.debian.org/UsrMerge
Change-Id: I975d3af0fa88869688673936a08189de800fba29
2023-07-18 14:12:38 +02:00
Oliver Smith 4f459b779e docker kill: wait until containers are stopped
As "docker kill" / "docker container kill" (alias) doesn't block until
the given container stops, make sure to always run "docker wait"
afterwards.

Closes: OS#5928
Change-Id: I0242ece96541d8036ebbf8b0f498ebf231db26b5
2023-03-07 09:02:02 +00:00
Oliver Smith f997b4e771 network_create: find free subnet automatically
Try multiple subnet numbers until successfully creating a network. This
way we can run the same ttcn3 testsuite multiple times in parallel
without conflicts (e.g. once against latest, once against nightly). Also
we don't need to make sure each new testsuite has a unique subnet
number anymore.

I've considered also adjusting network_bridge_create, but that gets used
exclusively by osmo-ran/jenkins.sh, a script which we don't actually run
in jenkins. It seems that in this script it makes more sense to not get
a random subnet number.

Related: OS#5802
Change-Id: I57152b08ef0f38e17e7019a8df032189b03f56cf
2023-01-16 15:19:29 +00:00
Oliver Smith 9a2556824a scripts/regen_doc: use SUBNET variable
Add a $SUBNET parameter and use it throughout the script, similar to
other ttcn3-*/jenkins.sh scripts. This is in preparation for figuring
out a free network in network_create() automatically in a future patch.

Related: OS#5802
Change-Id: I3bda4bd7280469ad5ee02104295134a2e0b768e3
2022-12-22 13:59:10 +01:00
Oliver Smith a7865832fa scripts/kernel-test/run-qemu.sh: update qemu args
Get rid of -nodefconfig, it has been removed in qemu 3.1. We are
supposed to use -no-user-config instead, which we already do.

Fix for this error we see since migrating to debian-bullseye:
  qemu-system-x86_64: -nodefconfig: invalid option

Related: OS#4969
Related: https://qemu.readthedocs.io/en/stable/about/removed-features.html#nodefconfig-removed-in-3-1
Change-Id: I4a00f90980bf6d141ef8d86786e08d405db6db0b
2021-12-17 10:20:58 +01:00
Oliver Smith 292e35c1d9 kernel-test: verify REMOTE_NAME and URL
If the checked out git repository already has a remote with the name
KERNEL_REMOTE_NAME, make sure that the KERNEL_URL matches the remote
URL.

Motivation for this change is osmo-ci
I5d4202a67a24d9c15a5b211fa29ce9d5b5a9d9c1, which will expose the
parameters in the jenkins job.

Related: OS#3208
Change-Id: I18b29011e3e8e2577bdf1a9c64c4370309cc8399
2021-03-01 08:50:57 +01:00
Oliver Smith cb2a8326c1 kernel-test: don't try to use KVM if not available
Disable KVM if /dev/kvm is missing, as it is apparently the case on our
jenkins nodes. This makes the tests run a bit slower, but not much. Add
kernel_test_wait_for_vm to sleep until the VM is booted up (~5s instead
of ~1s without KVM), so the first test in the testsuite does not fail
when using KVM.

The variable is useful to test the non-KVM code path even if KVM is
available on the host.

Related: OS#3208
Change-Id: I1f337af1e2de6db05b22636bc31a535404235559
2021-02-26 16:18:26 +00:00
Oliver Smith 79e48fd3ae ttcn3-ggsn-test: add kernel test
Make it possible to run ttcn3-ggsn-test against osmo-ggsn with the GTP
kernel module. This feature is enabled by environment variables
explained in ttcn3-ggsn-test/jenkins.sh, and can either use the
pre-built kernel from Debian, or build a kernel from source.

The kernel runs inside QEMU inside the usual osmo-ggsn-master docker
image.

Thanks to Pau for providing the kernel config and kernel-test scripts
that this patch is based on! I ended up modifying them quite a bit to
fit the docker use case, and to build the initrd (so we can use the
stock debian kernel).

Related: OS#3208
Change-Id: I54e752048eed2a170a1cf4e0fd410de255b9de5d
2021-02-26 09:32:39 +01:00
Harald Welte 306a51dd30 Enable IPv6 in docker networking
We previously only allocated IPv4 sub-nets to the network segments
created with 'docker network'.  Let's fix that by assigning both
IPv4 and IPv6 address ranges to each docker network.

Related: OS#4700
Change-Id: I8802208fddcce1ffa57e5626575d23d02b320d99
2020-08-13 15:01:58 +00:00
Daniel Willmann 533fef5815 regen_doc: Change IP network to an unused subnet
Previously we were using 178.18.12.0/24 which could have conflicted with
the osmo-bsc sccplite TTCN3 tests.

Change-Id: Ib5ab391ebb21ce2455fbb1ae47dd01ed53cd2e41
2019-07-24 18:05:02 +02:00
Oliver Smith 0436d95f2e regen_doc: check OSMO_INTERACT_VTY, fix default
Change default from osmo-interact-vty.py to osmo_interact_vty.py, which
is the name of the script in osmo-python-tests.git.

Check if that script is in PATH before building and running the docker
container.

Change-Id: I763c7379b710160e0155f1fde091137754141335
2019-06-27 09:57:01 +02:00
Daniel Willmann 63023eb7e6 regen_doc.sh: Add optional parameter to customize docker execution
The osmo-nitb-master image can run not only osmo-nitb, but also
osmo-bsc_nat. In that case we can't use the default command from
Dockerfile, but should provide our own. This argument makes it possible
to do so.

Change-Id: I52c3cb2cdcfb143e71ac2c1aa40bb466e41a0f5c
Related: OS#1700
2019-06-19 14:04:46 +02:00
Daniel Willmann 3b96cf3bb4 Add script to regenerate VTY and counter documentation
This script needs access to the VTY interface, so I changed some
remaining config files to bind the VTY interface to 0.0.0.0.

There are a couple of services that do that already.

Related: OS#1700
Change-Id: Ic5cf7f59de0c18d4c5568b89433c2b11db2a72a5
2019-06-18 18:18:08 +00:00