aboutgitcodebugslistschat
path: root/test/passt.mbuto
Commit message (Collapse)AuthorAgeFilesLines
* test: make passt.mbuto script more robustJon Paul Maloy2023-12-271-1/+3
| | | | | | | | | | | Creation of a symbolic link from /sbin to /usr/sbin fails if /sbin exists and is non-empty. This is the case on Ubuntu-23.04. We fix this by removing /sbin before creating the link. Signed-off-by: Jon Maloy <jmaloy@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
* passt: Relicense to GPL 2.0, or any later versionStefano Brivio2023-04-061-1/+1
| | | | | | | | | | | | | | | | | | | In practical terms, passt doesn't benefit from the additional protection offered by the AGPL over the GPL, because it's not suitable to be executed over a computer network. Further, restricting the distribution under the version 3 of the GPL wouldn't provide any practical advantage either, as long as the passt codebase is concerned, and might cause unnecessary compatibility dilemmas. Change licensing terms to the GNU General Public License Version 2, or any later version, with written permission from all current and past contributors, namely: myself, David Gibson, Laine Stump, Andrea Bolognani, Paul Holzinger, Richard W.M. Jones, Chris Kuhn, Florian Weimer, Giuseppe Scrivano, Stefan Hajnoczi, and Vasiliy Ulyanov. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
* test: Simplify data handling for transfer testsDavid Gibson2022-09-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Many of our tests are based around performing transfers of sample data across passt/pasta created links. The data flow here can be a bit hard to follow since, e.g. we create a file transfer it to the guest, then transfer it back to the host across several different tests. This also means that the test cases aren't independent of each other. Because we don't have the original file available at both ends in some cases, we compare them by generating md5sums at each end and comparing them, which is a bit complicated. Make a number of changes to simplify this: 1. Pre-generate the sample data files as a test asset, rather than building them on the fly during the tests proper 2. Include the sample data files in the mbuto guest image 3. Because we have good copies of the original data available in all contexts, we can now simply use 'cmp' to check if the transfer has worked, avoiding md5sum complications. 4. Similarly we can always use the original copy of the sample data on the send side of each transfer, meaning that the tests become more independent of each other. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
* test/passt.mbuto: Don't fail on missing guest public keyStefano Brivio2022-09-231-1/+1
| | | | | | | | | | | We won't necessarily run mbuto as part of regular tests: it can also be used for demos or out-of-tree tests. To keep the profile simple, leave the whole sshd setup there, which is otherwise harmless, but don't fail if guest-key.pub is missing in the current directory. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
* test: Use context system for guest commandsDavid Gibson2022-09-131-3/+29
| | | | | | | | | | | | | | | Extends the context system in the test scripts to allow executing commands within a guest. Do this without requiring an existing network in the guest by using socat to run ssh via a vsock connection. We do need some additional "sleep"s in the tests, because the new faster dispatch means that sometimes we attempt to connect before socat has managed to listen. For now, only use this for the plain "passt" tests. The "passt_in_ns" and other tests have additional complications we still need to deal with. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests: Use socat instead of netcatDavid Gibson2022-07-221-1/+1
| | | | | | | | | | | | | | | Commit 41c02e10 ("tests: Use nmap-ncat instead of openbsd netcat for pasta tests") updated the pasta tests to use the nmap version of ncat instead of the openbsd version, for greater portability. For some upcoming changes, however, we'll be wanting to use socat. "socat" can do everything "ncat" can and more, so let's move all the tests using host tools (either directly on the host or via mbuto generated images) to using socat instead. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> [sbrivio: Fix a typo in port specification, 31337 instead of x31337] Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
* tests: Correctly handle domain search list in dhclient-scriptDavid Gibson2022-07-221-3/+3
| | | | | | | | | | | Currently our small custom dhclient-script only handles the 'domain-name' option, which can just list a single domain, not the 'domain-search' option, which can handle several. Correct it to handle both. We also weren't emptying the resolv.conf file before we began, which could lead to surprising contents after multiple DHCP transactions. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests: Add some extra dhclient support directories to mbuto.imgDavid Gibson2022-07-221-1/+1
| | | | | | | | Although it can operate without them, dhclient can issue errors if it doesn't have /var/run to write a pid file and /var/lib to write a leases file. Create those in mbuto.img to stop it complaining. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests: Add rudimentary debugging to dhclient-scriptDavid Gibson2022-07-221-1/+5
| | | | | | | | We now supply a minimal dhclient-script of our own in the mbuto boot image. There are some problems with it, so add some basic logging to help debug it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests: Let Fedora find dhclient-script in /usr/sbinDavid Gibson2022-07-221-0/+1
| | | | | | | | | | | | Modern Fedora (and RHEL) systems have /sbin as a symlink to /usr/sbin (along with a number of similar links). Along with that it expects to find dhclient-script in /usr/sbin/dhclient-script rather than /sbin/dhclient-script. Link them together in our mbuto image so that the Fedora build of dhclient can find it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests: Remove no longer needed /usr/bin/bash linkDavid Gibson2022-07-221-2/+1
| | | | | | | | | | | | AFAICT the symlink we created in mbuto from /usr/bin/bash to /bin/sh was for the benefit of a dhclient-script which used /usr/bin/bash as its interpreter (e.g. in Fedora). That was a bit risky if the script really did require bash and we linked it to dash or another shell. We now supply our own custom dhclient-script, so we don't need the link any more. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* test: Embed script for dhclient(8) in mbuto(1) profileStefano Brivio2022-07-141-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | David reports that dhclient-script(8) on Fedora needs a number of binaries that are not included in PROGS of the current mbuto profile, and we would also need to include hostnamectl(1) there, which will fail without a systemd init. Embed a minimal script for dhclient(8) in the profile itself, written to /sbin/dhclient-script at boot, to just check what we need to check out of DHCP and DHCPv6 functionality. While at it, drop busybox and logger from PROGS, as we don't need them, and add hostname(1). While DHCP option 12 isn't supported yet by the DHCP implementation in passt, we should probably add it soon. Note: owing to the simplicity of this script, we now need to bring up the interface before starting dhclient: add this in test scripts where it's not the case yet. Reported-by: David Gibson <david@gibson.dropbear.id.au> Suggested-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com> note that we need to bring up the interface before starting dhclient
* test: Add external mbuto profile, drop udhcpc, and switch to itStefano Brivio2022-07-061-0/+37
This depends on a future change in mbuto to accept external profile files. Add a file defining what we need for tests and demos, dropping udhcpc and script as they're not needed anymore, and switch to it. Suggested-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>