Comments (22)
Test are running, there is just a minor issue in the test driver - auditctl is expected in /usr/sbin but located in /sbin, I will patch it. Most of the test failed, I have to investigate that. We should also introduce some logic to distinguish between rhel-6, rhel-7 and fedora tests.
from audit-testsuite.
Well I did my homework and check all the tests in RHEL6. Details are as follows.
Working
- syscalls_file
- user_msg
Broken but Compatible
- exec_execve - on RHEL6, it might take some time to populate events, test sometimes fails and sometimes passes, I hate adding sleeps to tests, but in this case adding 1s sleep before events before ausearch call makes it green
Broken
- file_* - are these tests for directory watches? Is it supposed to be working on RHEL6? Rules are added correctly but no syscalls are audited at all
Generally Broken
- login_tty - this test is broken for all distributions at the moment.
from audit-testsuite.
Great, thanks for looking into this, I think we can move this from Q to BUG.
from audit-testsuite.
Ok, I tracked down the problem with the file_* tests. The tempdir and tempfile functions don't honour the TEMPLATE assignment, so the intended file never gets created or tested. Testing with $filename = "$dir/$key";system("touch $filename"); works fine.
from audit-testsuite.
The login_tty test doesn't work on RHEL6 because that feature/bugfix hasn't been backported to RHEL6.
from audit-testsuite.
Not directly related to this issue, but in the process of debugging the tests, I found it difficult to parse the log output. It would be nice if there was a clear delimiter between each subdir test so when failures happen it is easier to see what part of the output goes with which test case.
from audit-testsuite.
from audit-testsuite.
Here's a quick and dirty tempfile TEMPLATE workaround for RHEL6: rgbriggs@4d0fddc
from audit-testsuite.
Here's a quick and dirty tempfile TEMPLATE workaround for RHEL6: rgbriggs@4d0fddc
Thanks guys for the help on this.
One of the things that is nice about tempfile() is the automatic cleanup when UNLINK is true. @rgbriggs you mention that RHEL-6.x doesn't honor the tempfile() TEMPLATE parameter, does it still generate a file if we omit the TEMPLATE parameter? The name/location of the temp file generally shouldn't be important to us (assuming it is created in a valid temp/writable location, but I think that is a safe assumption).
from audit-testsuite.
It still generates a file while seemingly ignoring the TEMPLATE parameter, so I assume it would generate the same pattern of file with the TEMPLATE parameter missing. The file was generated in a safe place. Knowing that the TEMPLATE parameter was ignored (or incorrect syntax of the supplied parameter?) then I would cast some doubt that the UNLINK parameter was honoured either.
from audit-testsuite.
It should be easy enough to verify if the UNLINK worked.
from audit-testsuite.
The UNLINK parameter was also ignored. There are temp files hanging around in /tmp/.
from audit-testsuite.
Thanks for checking, but that's a bummer. We definitely need to find an alternate method of creating, and cleaning up, temporary files that works on RHEL-6.x forward (yes, I'm intentionally ignoring RHEL-5.x).
from audit-testsuite.
The quick and dirty patch from #19 (comment) does clean up after itself. The tempdir command does reap the files from the touch system command.
from audit-testsuite.
So the TEMPLATE parameter works for tempdir() but not tempfile()? I didn't think that was the case based on your earlier comment, perhaps I misunderstood.
I don't see any rm/unlink actions in the quick n' dirty patch so the only way the temp files could be deleted is if $dir was deleted. What am I missing?
from audit-testsuite.
The TEMPLATE parameter appears to not work for either tempdir() or tempfile(), but it appears unlink works or defaults to on for tempdir() but not for tempfile(), which surprised me.
from audit-testsuite.
Huh, yeah, I wouldn't have guess that either. What a mess.
This unpredictability makes me wonder about the difficulty of doing our own temp file management.
from audit-testsuite.
Well, for other tests I've just been making tempfiles based on the unique key generated for the test and cleaning up after myself.
from audit-testsuite.
That may be the only reasonable solution, my only concern is cleanup in the case of abnormal termination, e.g. kill the test via Ctrl-C. That said, I'm not even sure the existing tempdir()/tempfile() solution handles this correctly, and I'm also not sure how much we should ultimately care about this; as long as everything is created under /tmp, artifacts under corner cases may be acceptable.
from audit-testsuite.
It actually might be good to have some "clean-up stack" which is called when test exits or is killed / aborted. For instance, when you create a temporary file, you just add a removing call-back onto clean-up stack. Callbacks from the stack are then called by some exit subroutine or from a signal handler. Does it make sense? I can open an issue and write something for demonstration and we can then decide whether it is useful or not...?
from audit-testsuite.
@The-Mule yes, that makes sense to me (and I think what the original tempfile/tempdir code did), I just don't currently know how to do signal/exit handlers in perl; if you can write up a demonstration I think that would be very helpful.
from audit-testsuite.
It's not clear how much effort we want to put into RHEL-6.x at this point so let's close this out for now.
from audit-testsuite.
Related Issues (20)
- BUG: lost_reset is stubbornly failing on my aarch64 test system (again) HOT 7
- RFE: recent audit userspace changes make the test suite noisy HOT 1
- BUG: compilation error on Fedora 38 HOT 1
- BUG: filter_exclude fails when execute in specific context HOT 2
- Q: filter_execlude fail with "Only msgtype field can be used with exclude filter" HOT 1
- Q: accomodate tests for known issues for which fix does not yet exist
- RFE: create a debug flag/option so we have a consistent way to toggle debugging output HOT 4
- BUG: sporadic failures in lost_reset HOT 11
- BUG: filter_exclude test fails to parse minimal selinux context
- RFE: Basic Event Validation
- RFE: add test for fanotify events HOT 4
- RFE: test for audit container ID functionality HOT 10
- RFE: test for container id routing
- BUG: Debian instructions missing libc6-dev-i386 HOT 2
- RFE: incorporate Jan's stress test for tree watches HOT 1
- BUG: fix references to b64 on generic tests HOT 2
- BUG: lost_reset fails to lose messages on some systems, failing test HOT 3
- RFE: test audit signal and ptrace functionality
- Q: why does tests/Makefile override PATH? HOT 2
- BUG: bpf tests fail on aarch64 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audit-testsuite.