| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
...and, while at it, use @ to denote a enter key in demo scripts.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
| |
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
| |
The licensing terms are already clear from the SPDX tags, but adding
a LICENSE file should make packaging easier.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
|
| |
This might happen e.g. if we find a 'builtin' token in a multi-line
modprobe output: the modprobe command will succeed, but that doesn't
necessarily correspond to a module file.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
|
| |
...and not before -- otherwise a -T option without -C will cause all
collections to be enabled.
Fixes: 2584ae2bd68b ("mbuto: kselftests: Fill in collections if none are given")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
| |
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
| |
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
| |
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
| |
This is nice for demos but should also be quite practical.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
|
| |
If we keep the existing directory and just install over it, all the
programs from previous runs will be sourced from there, too.
Suggested-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
| |
Quote it, when checking if it's empty.
Fixes: 2584ae2bd68b ("mbuto: kselftests: Fill in collections if none are given")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
| |
Add missing quotes around variable assignments.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Currently we assume that given a test collection, there will always be some set
of kernel modules required for running the tests in the collection. This
assumption is false for some collection, such as seccomp, and this patch handles
such cases.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
|
| |
This fixes the case where just the profile is given, i.e.
./mbuto -p kselftests
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The aim is the same as commit 6199e368f68d ("mbuto: Parse options
before fakeroot check"), without, however, touching arguments before
calling the script itself, which was the problem highlighted by
commit 2458f4064b63 ("mbuto: undo commit 6199e368").
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The run_kselftest.sh script, which is run upon booting the image created by
mbuto, allows specifying multiple collections and specific tests, as in:
run_kselftest.sh -c "net proc" -t "x86:iopl_32 timers:rtcpie"
The above command runs (1) all the tests in the net collection, (2) all the
tests in the proc collection, (3) the iopl_32 test from the x86 collection,
and (4) the rtcpie test from the timers collection. This patch enables the same
functionality in mbuto. Now users can run mbuto as follows:
mbuto -p kselftests -C "net proc" -T "x86:iopl_32 timers:rtcpie"
and mbuto generates an image that runs the same set of tests. In addition, mbuto
installs only the tests in the specified collections in the image. For example,
for the above command line, mbuto will install all the tests in the net, proc,
x86, and timers collections (but it will only run iopl_32 and rtcpie test from
the last two). Mbuto also installs only the modules needed for running these
tests and warns the user if there are missing modules.
Mbuto also warns the user if an invalid collection name is passed to the -C
suboption. Due to irregular structure of Makefiles in selftest directories, it
is hard to warn the user if an invalid test name is passed to the -T option. In
this case the user will find out about the mistake after the kernel boots and
run_kselftest.sh fails to run the test.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to pass suboptions multiple arguments as a single string, as in
SUBOPT_collection="net proc"
Without these quotes the result of eval becomes
SUBOPT_collection=net proc
which assings only the value "net" to SUBOPT_collection.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Commit 6199e368 moves argument parsing before checking fakeroot and saves the
arguments in ARGS variable. Unfortunately, passing ARGS to the recursive call
flattens and removes quotes, which disables passing multiple arguments to
suboptions, as in -C "net proc". For now we undo this commit to enable multiple
argument passing to suboptions.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
|
|
| |
The examples in the help error message still show -c and -t suboptions when
choosing specific kselftest collections and tests. Capitalize them to match the
actual suboptions.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
|
|
| |
In multiple places we loop over a list by joining its elements with a prefix,
suffix, and a delimiter into a single string. Add a function for this
functionality and replace these loops with a function.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
|
| |
Add a function to find the difference of two lists and use that
function to determine the list of missing modules.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add suboption -C for the case of -p kselftests for choosing a test
collection to run. For example, specifying "-p kselftests -C net"
creates an image that contains only the tests from the net collection
and only the kernel modules needed to run those tests.
If there are missing modules for running the tests, a warning will be
emitted showing missing modules names. The -C option is similar to
the -c option of run_kselftests.sh, but unlike run_kselftest.sh's
option it currently doesn't support specifying multiple collections.
This will be fixed later.
Also add suboption -T for the case of -p kselftests for choosing a
specific test. For example, specifying:
-p kselftests -T net:ip_defrag.sh"
create an image that runs only the single test when booted. This
option is also similar to run_kselftest.sh's -t option, but it
lacks some functionality, which will be added later.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
v1 -> v2: Update TOOLS, Use variable names for commands, and use capitalized
versions of run_kselftests.sh options (-C and -T).
|
|
|
|
|
|
| |
Redirect modprobe to /dev/null to avoid verbose output. Remove unnecessary "/".
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
|
|
| |
We first assign the output of modprobe to a string and check if it is a built-in
module and add its node if so. Otherwise, we process every token in modprobe
output and try to see if it is a module.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Since we are going over the output of modprobe and trying to figure out if the
token is a module name, sometimes we get strings like "--install", which breaks
basename and modprobe commands. To fix this problem, we append "--" to these
commands.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
|
|
|
| |
When specify -d as part of __d_opt variable, it is passed as a single string to
modprobe, like "-d /foo/bar", and modprobe fails to figure out the directory
name correctly. With this patch, we pass it as two different strings, like "-d"
"/foo/bar", and modprobe works correctly.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
| |
with two -d switches no modprobe produces wrong output.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
|
|
|
|
|
|
| |
Just base and kselftests profile demos so far.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
| |
...we don't want any of that in the output.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
|
|
| |
We need to make sure test programs are built and everything is
included in tools/testing/selftests/kselftest_install before
we can include that in the guest image.
Reported-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
| |
If modules are installed in subdirectories of lib/modules, we need to
pass a matching wildcard to du(1).
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
| |
This avoids the need to set IFS and reset it around libs_copy()
calls.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
| |
This offers some flexibility to source things from profile
definitions themselves.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
| |
The output of 'command -v' varies widely across shells, which(1)
output looks relatively consistent.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
| |
Make indentation of FIXUP definitions consistent. Add /usr/local/bin
to PATH, and drop device nodes the 'passt' profile doesn't need.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
This can be used to run kselftests from a kernel tree without
having to install kernel and modules onto a distribution image,
for example:
kvm -m 8192 -cpu host -smp 2 -kernel arch/x86/boot/bzImage -initrd $(mbuto -p kselftests) -nographic -nodefaults -serial stdio -append "console=ttyS0"
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of having one device node per line, use commas to separate
attributes, if given.
Take links as pairs of tokens, instead of requiring one line for
each.
This makes command-line overrides actually usable without the need to
resort to printf(1) tricks.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
|
| |
...so that we can display the help message even if fakeroot is not
available.
Suggested-by: Wainer dos Santos Moschetta <wmoschet@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
| |
It's typically faster also to boot, and we don't want to take
seconds when running in a subshell on qemu's command line.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
| |
lz4 needs an explicit output file if we're not compressing to stdout.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It already serves other purposes. Make 'kata' and 'kata_debug'
explicit profiles, create a base one, and drop the 'pbench' profile
which wasn't really used.
Output templates are also defined by profiles. This allows convenient
usage in a subshell, e.g.:
kvm -kernel ... -initrd $(mbuto)
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Example: glibc needs, for basic tasks such as domain resolution,
libnss_files and libnss_dns, which in turn links to libresolv.
Add a LIBS_DLOPEN variable to hold pairs of libraries typically
doing this and additional libraries to copy -- not a complete list,
just what's strictly needed for basic functionality.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
| |
...instead of '-'. This shouldn't be needed in theory, but using '-' as
a name confuses mountpoint parsing in recent builds of kata-agent.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
| |
...otherwise, it will fail for a kernel version which is not the
currently running one.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
| |
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
| |
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
| |
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
| |
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|