Giter VIP home page Giter VIP logo

Comments (22)

The-Mule avatar The-Mule commented on August 27, 2024

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.

The-Mule avatar The-Mule commented on August 27, 2024

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.

pcmoore avatar pcmoore commented on August 27, 2024

Great, thanks for looking into this, I think we can move this from Q to BUG.

from audit-testsuite.

rgbriggs avatar rgbriggs commented on August 27, 2024

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.

rgbriggs avatar rgbriggs commented on August 27, 2024

The login_tty test doesn't work on RHEL6 because that feature/bugfix hasn't been backported to RHEL6.

from audit-testsuite.

rgbriggs avatar rgbriggs commented on August 27, 2024

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.

The-Mule avatar The-Mule commented on August 27, 2024

from audit-testsuite.

rgbriggs avatar rgbriggs commented on August 27, 2024

Here's a quick and dirty tempfile TEMPLATE workaround for RHEL6: rgbriggs@4d0fddc

from audit-testsuite.

pcmoore avatar pcmoore commented on August 27, 2024
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.

rgbriggs avatar rgbriggs commented on August 27, 2024

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.

pcmoore avatar pcmoore commented on August 27, 2024

It should be easy enough to verify if the UNLINK worked.

from audit-testsuite.

rgbriggs avatar rgbriggs commented on August 27, 2024

The UNLINK parameter was also ignored. There are temp files hanging around in /tmp/.

from audit-testsuite.

pcmoore avatar pcmoore commented on August 27, 2024

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.

rgbriggs avatar rgbriggs commented on August 27, 2024

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.

pcmoore avatar pcmoore commented on August 27, 2024

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.

rgbriggs avatar rgbriggs commented on August 27, 2024

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.

pcmoore avatar pcmoore commented on August 27, 2024

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.

rgbriggs avatar rgbriggs commented on August 27, 2024

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.

pcmoore avatar pcmoore commented on August 27, 2024

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.

The-Mule avatar The-Mule commented on August 27, 2024

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.

pcmoore avatar pcmoore commented on August 27, 2024

@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.

pcmoore avatar pcmoore commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.