-
Notifications
You must be signed in to change notification settings - Fork 25
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
BUG: some tests fail on RHEL-6 #19
Comments
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. |
There are differences between Linux distributions - testsuite should respect them to some extent to run correctly. Now it is possible to run testsuite on Fedora, RHEL6, RHEL7 and Debian systems. Moreover, some audit features available, for instance, for Fedora or RHEL7 are missing in RHEL6. To make testsuite more robust, it is now possible to use DISTRO environment variable which describes system under test. This change resolves GH Issue linux-audit#19 [1]. [1] linux-audit/audit-kernel#19 Signed-off-by: Ondrej Moris <omoris@redhat.com>
There are differences between Linux distributions - testsuite should respect them to some extent to run correctly. Now it is possible to run testsuite on Fedora, RHEL6, RHEL7 and Debian systems. Moreover, some audit features available, for instance, for Fedora or RHEL7 are missing in RHEL6. To make testsuite more robust, it is now possible to use DISTRO environment variable which describes system under test. This change resolves GH Issue #19 [1]. [1] linux-audit/audit-kernel#19 Signed-off-by: Ondrej Moris <omoris@redhat.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Well I did my homework and check all the tests in RHEL6. Details are as follows. Working
Broken but Compatible
Broken
Generally Broken
|
Great, thanks for looking into this, I think we can move this from Q to BUG. |
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. |
The login_tty test doesn't work on RHEL6 because that feature/bugfix hasn't been backported to RHEL6. |
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. |
Indeed, I usually call this when debugging:
# HARNESS_VERBOSE=1 HARNESS_OPTIONS="c" SUBDIRS="file_create" make -e test
First option makes standard output visible, second just colorize
summary/results from the rest. When parsing records within while loop, it
is always better to print each line - during the test execution, it is not
visible anyway and with HARNESS_VERBOSE=1 it is really helpful.
…On Fri, Dec 2, 2016 at 12:38 PM, Richard Guy Briggs < ***@***.***> wrote:
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.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKfnBJ9v1xYS5liOdVP2zsjjh2eNv4lOks5rEAM8gaJpZM4HdUtX>
.
|
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). |
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. |
It should be easy enough to verify if the UNLINK worked. |
The UNLINK parameter was also ignored. There are temp files hanging around in /tmp/. |
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). |
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. |
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? |
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. |
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. |
Well, for other tests I've just been making tempfiles based on the unique key generated for the test and cleaning up after myself. |
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. |
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...? |
@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. |
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. |
We need to attempt a test run on a RHEL-6 system.
The text was updated successfully, but these errors were encountered: