Misc fixes and virtme-ng support#96
Open
cgzones wants to merge 17 commits into
Open
Conversation
WOnder93
reviewed
Dec 16, 2024
|
|
||
| /* This one should hit the FILE__GETATTR or FILE__IOCTL test */ | ||
| rc = ioctl(fd, FIGETBSZ, &val); | ||
| rc = ioctl(fd, FS_IOC_GETFLAGS, &val); |
Member
There was a problem hiding this comment.
Haven't yet had a chance to go through all the changes, but this part seems to make the ioctl test fail under NFS (see tools/nfs.sh). Can you look into it?
Contributor
Author
There was a problem hiding this comment.
Thanks for spotting, fixed via
/*
* This one should hit the FILE__GETATTR or FILE__IOCTL test.
* FIGETBSZ is not available on overlayfs,
* and FS_IOC_GETFLAGS is not available on NFS.
*/
rc = ioctl(fd, FIGETBSZ, &val);
if( rc < 0 ) {
if(errno == EINVAL) {
rc = ioctl(fd, FS_IOC_GETFLAGS, &val);
}
if( rc < 0 ) {
perror("test_ioctl:FIGETBSZ/FS_IOC_GETFLAGS");
exit(1);
}
}8f2ef97 to
15969f0
Compare
Pass make options, e.g. number of jobs, which allows to build multiple test executables in a single sub-directory in parallel. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Reported by shellcheck(1). Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Improve portability and avoid actual issues being hidden. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Christian Göttsche <cgzones@googlemail.com> --- v2: order targets alphabetically
OverlayFS does not support a couple of ioctl's and other features, like
NFS, so skip and tweak relevant tests.
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
v2: fix support for NFS, by using FS_IOC_GETFLAGS only on FIGETBZ
failure
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Also fix a typo in the unknown protocol case. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
fsnotify support might be missing from the running kernel. Pre-load the loop module to ensure creating a loop device succeeds. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Required for inet_socket/tcp checks. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Required for netlink_socket tests. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Be more cautious on unexpected failures and input:
binder
Avoid returning garbage value from binder_parse() in case of an
unexpected (impossible?) empty buffer.
Store create_bpf_*() results temporarily in an int to actually
perform the error checks (they are currently no-ops on unsigned).
bpf
Initialize variable in case the program gets called without the
associated option.
cap_userns
Use appropriate types and casts to avoid implicit conversions.
execshare
Avoid use of void pointer arithmetic.
fdreceive
Do not call non async-safe exit(3) in signal handler.
Drop dead assignment.
filesystem
Initialize variables in case the programs get called without the
associated options.
inet_socket/unix_socket
Declare usage() as noreturn to help compilers avoid issuing
inaccurate warnings.
inherit
Use a large enough buffer for a potential huge PID.
key_socket
Avoid comparison of signed with unsigned integer.
module_load
Correctly check for an open(2) failure.
nnp_nosuid
Check if wait(2) succeeded before checking the child status.
notify
Check if opening file was successful.
Use appropriate type for read(2) return value.
prlimit
Set all members of the new limit structure.
sctp
Use appropriate iterator type.
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Warnings issued by -Wall and -Wextra most of the time point to actual issues in the code. Treat the as error, so the resulting test run failure will be investigated and the issue handled. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Clang does not support header files included in the compile command:
clang -g -O2 -Werror -Wall -Wextra -Wno-error=unused-parameter -D_GNU_SOURCE -DHAVE_BPF -DHAVE_FS_WATCH_PERM -DHAVE_BPF bpf_test.c bpf_common.c bpf_common.h -lselinux -lbpf -o bpf_test
clang: error: cannot specify -o when generating multiple output files
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the following patches the testsuite runs successfully in a virtme-ng environment. A minimal virtme-ng default kernel configuration was used combined with the testsuite's included defconfig.
Also while working on failed testcases I tweaked some scripts and test code.
Test result:
The included policy needs to be tweaked (not included in this pull request):
Also to speed up the development cycle I used the following two scripts:
tools/vng_stage1.sh
tools/vng_stage2.sh