airbnb / binaryalert

BinaryAlert: Serverless, Real-time & Retroactive Malware Detection.
https://binaryalert.io
Apache License 2.0
1.41k stars 187 forks source link

test error #101

Closed goochi1 closed 6 years ago

goochi1 commented 6 years ago

Background

Running for the first time

getting 4 errors:

ERROR: test_match_eicar_string (tests.rules.eicar_rule_test.EicarRuleTest) Should match the exact EICAR string.

Traceback (most recent call last): File "/Users/sgooch/Documents/Stash/binaryalert/tests/rules/eicar_rule_test.py", line 16, in setUp with open(EICAR_TXT_FILE, 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: '/Users/sgooch/Documents/Stash/binaryalert/tests/rules/../files/eicar.txt'

====================================================================== ERROR: test_match_eicar_with_trailing_spaces (tests.rules.eicar_rule_test.EicarRuleTest) Trailing whitespace is allowed after the EICAR string.

Traceback (most recent call last): File "/Users/sgooch/Documents/Stash/binaryalert/tests/rules/eicar_rule_test.py", line 16, in setUp with open(EICAR_TXT_FILE, 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: '/Users/sgooch/Documents/Stash/binaryalert/tests/rules/../files/eicar.txt'

====================================================================== ERROR: test_no_match_if_eicar_is_not_beginning (tests.rules.eicar_rule_test.EicarRuleTest) No match if EICAR string is not the beginning of the file.

Traceback (most recent call last): File "/Users/sgooch/Documents/Stash/binaryalert/tests/rules/eicar_rule_test.py", line 16, in setUp with open(EICAR_TXT_FILE, 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: '/Users/sgooch/Documents/Stash/binaryalert/tests/rules/../files/eicar.txt'

====================================================================== ERROR: test_no_match_if_eicar_is_not_end (tests.rules.eicar_rule_test.EicarRuleTest) No match if non-whitespace comes after the EICAR string.

Traceback (most recent call last): File "/Users/sgooch/Documents/Stash/binaryalert/tests/rules/eicar_rule_test.py", line 16, in setUp with open(EICAR_TXT_FILE, 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: '/Users/sgooch/Documents/Stash/binaryalert/tests/rules/../files/eicar.txt'


Ran 74 tests in 3.971s

FAILED (errors=4) TEST FAILED: Unit tests failed

austinbyers commented 6 years ago

Hi @goochi1,

I'm not really sure what's going on here - it looks like you accidentally deleted the eicar.txt file. Can you provide more context? I'm not able to reproduce the error:

$ git clone --branch v1.1.0 --depth 1 https://github.com/airbnb/binaryalert
$ cd binaryalert
$ virtualenv -p python3 venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ ./manage.py unit_test
..........................................................................
----------------------------------------------------------------------
Ran 74 tests in 3.619s

OK

Maybe if you could answer the following questions, I'll be able to better help out:

  1. What does git log show as the latest commit?
  2. What operating system are you running on?
  3. How are you running the test? ./manage.py or some other way?
  4. Have you made any changes? What does git status show?
goochi1 commented 6 years ago

Hi i will clone and try agian

goochi1 commented 6 years ago

Hi I believe it was a blocker from my work VPN and runs now fine. thank you for your assistance.

Can i also ask, is there a way of stating a profile i want it to use for my aws cli rather than the default keys?

austinbyers commented 6 years ago

Great, I'm glad it worked!

Yes, the easiest way to specify a profile is to simply export an environment variable: export AWS_PROFILE=name-of-your-other-profile. And that's it! Both the manage.py CLI and Terraform will use that environment variable to set the profile.