File tree Expand file tree Collapse file tree
src/code42cli/cmds/search Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,15 +18,42 @@ jobs:
1818
1919 steps :
2020 - uses : actions/checkout@v2
21+ with :
22+ path : code42cli
2123 - name : Setup Python
2224 uses : actions/setup-python@v1
2325 with :
2426 python-version : ${{ matrix.python }}
2527 - name : Install tox
2628 run : pip install tox==3.17.1
2729 - name : Run Unit tests
28- run : tox -e py # Run tox using the version of Python in `PATH`
30+ run : cd code42cli; tox -e py # Run tox using the version of Python in `PATH`
2931 - name : Submit coverage report
3032 uses : codecov/codecov-action@v1.0.7
3133 with :
32- file : ./coverage.xml
34+ file : code42cli/coverage.xml
35+ - name : Checkout mock servers
36+ uses : actions/checkout@v2
37+ with :
38+ repository : code42/code42-mock-servers
39+ path : code42-mock-servers
40+ - name : Add mock servers host addresses
41+ run : |
42+ sudo tee -a /etc/hosts <<EOF
43+ 127.0.0.1 core
44+ 127.0.0.1 alerts
45+ 127.0.0.1 alert-rules
46+ 127.0.0.1 detection-lists
47+ 127.0.0.1 audit-log
48+ 127.0.0.1 file-events
49+ 127.0.0.1 storage
50+ 127.0.0.1 preservation-data-service
51+ 127.0.0.1 connected-server
52+ 127.0.0.1 cases
53+ EOF
54+ - name : Install ncat
55+ run : sudo apt-get install ncat
56+ - name : Start up the mock servers
57+ run : cd code42-mock-servers; docker-compose up -d --build
58+ - name : Run the integration tests
59+ run : cd code42cli; tox -e integration
Original file line number Diff line number Diff line change @@ -152,10 +152,12 @@ def server_options(f):
152152 type = click .Choice (ServerProtocol (), case_sensitive = False ),
153153 default = ServerProtocol .UDP ,
154154 help = "Protocol used to send logs to server. "
155- "Use TLS for additional security. Defaults to UDP." ,
155+ "Use TCP- TLS for additional security. Defaults to UDP." ,
156156 )
157157 certs_option = click .option (
158- "--certs" , type = str , help = "A CA certificates-chain file for the TLS protocol."
158+ "--certs" ,
159+ type = str ,
160+ help = "A CA certificates-chain file for the TCP-TLS protocol." ,
159161 )
160162 ignore_cert_validation = click .option (
161163 "--ignore-cert-validation" ,
Original file line number Diff line number Diff line change @@ -49,13 +49,13 @@ def append_profile(command):
4949 return "{} --profile {}" .format (command , TEST_PROFILE_NAME )
5050
5151
52- @pytest .yield_fixture (scope = "session" )
52+ @pytest .fixture (scope = "session" )
5353def udp_dataserver ():
5454 with DataServer (protocol = "UDP" ):
5555 yield
5656
5757
58- @pytest .yield_fixture (scope = "session" )
58+ @pytest .fixture (scope = "session" )
5959def tcp_dataserver ():
6060 with DataServer (protocol = "TCP" ):
6161 yield
Original file line number Diff line number Diff line change 11import os
22import subprocess
3+ import time
34from shlex import split as split_command
45
56from code42cli .main import cli
@@ -48,7 +49,8 @@ def __init__(self, protocol="TCP"):
4849 self .process = None
4950
5051 def __enter__ (self ):
51- self .process = subprocess .Popen (self .command .split (" " ))
52+ self .process = subprocess .Popen (self .command , shell = True )
53+ time .sleep (1 )
5254
5355 def __exit__ (self , exc_type , exc_val , exc_tb ):
5456 self .process .kill ()
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ deps = pre-commit
3939skip_install = true
4040commands = pre-commit run --all-files --show-diff-on-failure
4141
42-
4342[testenv:nightly]
4443deps =
4544 pytest == 4.6.11
4847 git+https://github.com/code42/py42.git@master# egg=py42
4948 git+ssh://git@github.com/code42/c42eventextractor.git@master# egg=c42eventextractor
5049
50+ [testenv:integration]
51+ commands =
52+ pytest -v -rsxX -l --tb =short --strict -m integration
5153
5254[pytest]
5355markers =
You can’t perform that action at this time.
0 commit comments