-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Consolidate test rootfs in single place #258
base: master
Are you sure you want to change the base?
Conversation
If people are happy with the way things are going, we can land all the patches but the (obviously incomplete) fifth one. Thus we don't have to boil the ocean in one go - aka we don't have to fix everything in this one PR. |
We could even change the string options For example we currently have a dozen or so instances of Let me know what you think o/ |
Pondering a bit, I'm inclined to have v2 roughly as follows. Let me know if anything seems amiss.
The comparison (aka correct) files will live in "$TC_ROOTFS/compare/" (stdout.txt stderr.txt, modules.alias etc). The test infra will preemptively fail if a) the bool is set yet file is missing or b) when file is present but bool is false. |
@evelikov that new format looks good. Maybe also keep a
... which expects the same file to be present in $TC_ROOTFS/compare/ |
Currently test-weakdep is the only test which explicitly sets the kernel module lookup directory and the modprobe.d location. It does so by explicitly hard-coding the full path for both, thus effectively bypassing the path handling done in our `LD_PRELOAD` module `path.so`. Just use `kmod_new(NULL, NULL);` which will ensure that everything is handled relatively to `TC_ROOTFS` defined further down in the test. Note: this technically reduces our test coverage, although kmod_new() is not the goal of this test and should be handled separately. Noticed while removing the TESTSUITE_ROOTFS instances from DEFINE_TEST() Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Link: #258 Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Shortly we'll be moving some of the duplication from the individual test configuration into the common test-suite code. Add a helper or two to make that transition smoother. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Shortly we'll be moving some of the duplication from the individual test configuration into the common test-suite code. Add a helper or two to make that transition smoother. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Shortly we'll be moving some of the duplication from the individual test configuration into the common test-suite code. Add a helper or two to make that transition smoother. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reduce the test boilerplate by moving the TESTSUITE_ROOTFS constant out of the indigo dual test configuration. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
With this commit all our tests have a single entrypoint (from a file-system POV) which means we get a lot less duplication, all test specific files (be that config, input, expectations, etc) are in designated folders. As result, this paves the route to running the tests in chroot-like enviroment were we can drop-in the folder, adjust the module rootfs location in path.so or equivalent and have the test(s) churn. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
873a260
to
9d0ce49
Compare
I picked the first commit, "testsuite/test-weakdep: remove custom handling". |
This series started off as de-duplicating the macros that we copy-paste across the tests and ultimately paved the way to allowing the tests to run in a VM aka #50.
That goal is not yet complete, but the general premise is that:
DEFINE_TEST
provides the rootfs (just the test sub-folder) and unameoutput
or theTESTSUITE_ROOTFS
happens in the shared places -testsuite.c
and/orpath.c
As you can see the patch series isn't even complete yet. Although since it's churn heavy I thought that sending it out early to feedback, would be a good idea.
Aside: I have another 1-2 series to further reduce the boilerplate, following which the tests will start to flow 🤞