Jump to content

How to test command line scans


Recommended Posts

Hi there

 

I've created a command line script with ecls, which will be called by an application to virus check files that are uploaded to a specific server.  I'm able to test the command line script and get exit codes of 0 and 50 (by scanning a suspect exe).  Does anyone have any ideas on how testing can be done so that the exit codes can be returned so I check that my exception handling covers all scenarios and these tests be incorporated into my unit tests and in our continuous integration cycle?  

 

Gavin 

Link to comment
Share on other sites

  • ESET Moderators

Hello Gavin,

 

you could get more info by running ecls.exe with "--help" option so run "ecls.exe --help"

 

Exit codes are following:

  0    no threat found
  1    threat found and cleaned
  10   some files could not be scanned (may be threats)
  50   threat found
  100  error
Link to comment
Share on other sites

  • 2 weeks later...
  • ESET Moderators

Hello,

 

You can also use the harmless EICAR test file which all anti-malware programs identify as a threat for testing purposes.  It is actually just a text file, but all anti-malware programs report it as a virus.

 

As one colleague put it, think of it as the digital version of the "test" button on a smoke alarm.

 

Regards,

 

Aryeh Goretsky

Link to comment
Share on other sites

Hi Aryeh 

 

Thanks for the information.  This is exactly was I was looking for.  Currently I've been using the MediaInfo installer (hxxp://mediaarea.net/en/MediaInfo) as this throws up an exit code of 10.  I'll see about getting this file and incorporating this into my unit tests instead. 

 

Gavin 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...