Forum Discussion

JonIsTooShort's avatar
JonIsTooShort
New Contributor
13 years ago

Testrunner as a cron job on linux having trouble

I'm having some trouble with my cron job running testrunner on a linux server.

I've got a perl script running my test suites and outputting the results to a file, then doing a little analysis and emailing the results off on a nightly basis. Well if I run my perl script manually, it works great. The tests run, the output redirects to the file, everything is quite dandy.

When I try to use cron to run the script, instead of getting my test results in the file, I get only the header that shows testrunner is beginning to run, with the SOAPUI_HOME variable showing as set.

Where do I begin to look for trouble with this? I am keen to do some investigation myself, but I'm not even entirely sure where to start.
  • Your cron job is running as root right? What if you run your script as root? What if you try to run your script with su - <USER> perlscript.pl .... ?

    Is there really nothing else in the logs? Are you redirecting both stderr and stdout to the same file?

    Other than that there could possibly be an selinux issue, do you have selinux enabled? This is a longshot but still worth a quick check (normally it would affect your normal execution as well).

    Regards
    / Henrik, SmartBear Sweden
  • So I've done a little more investigation, and the cron job is running as my local user, not as root. So that shouldn't make too much of a difference.

    Do you know what might cause testrunner to ONLY output this bit:


    ================================
    =
    = SOAPUI_HOME = <actual soapui home directory>
    =
    ================================


    And nothing else? I'll see if perhaps it's having trouble finding the test suite, but I've been outputting the exact command that runs to a log file, and it works fun when I run that.

    I have not tried your second suggesting yet, I will look into that too.