This repository was archived by the owner on Oct 14, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ // todo: Integrate into github ci pipeline
2+ const { scan } = require ( "./helpers" ) ;
3+
4+ test (
5+ "ssh-scan should find a couple of findings for a dummy ssh service" ,
6+ async ( ) => {
7+ const { categories, severities, count } = await scan (
8+ "ssh-scan-dummy-ssh" ,
9+ "ssh-scan" ,
10+ [ "-t" , "dummy-ssh.demo-apps.svc" ] ,
11+ 90
12+ ) ;
13+
14+ expect ( count ) . toBe ( 4 ) ;
15+ expect ( categories ) . toMatchInlineSnapshot ( `
16+ Object {
17+ "SSH Policy Violation": 3,
18+ "SSH Service": 1,
19+ }
20+ ` ) ;
21+ expect ( severities ) . toMatchInlineSnapshot ( `
22+ Object {
23+ "informational": 1,
24+ "medium": 3,
25+ }
26+ ` ) ;
27+ } ,
28+ 3 * 60 * 1000
29+ ) ;
30+
31+ test (
32+ "ssh-scan should gracefully handle a non-existing target" ,
33+ async ( ) => {
34+ await expect (
35+ scan (
36+ "ssh-scan-non-existing" ,
37+ "ssh-scan" ,
38+ [ "-t" , "this-target-doesnt-exist.demo-apps.svc" ] ,
39+ 180
40+ )
41+ ) . rejects . toThrow (
42+ 'Scan failed with description "Failed to run the Scan Container, check k8s Job and its logs for more details"'
43+ ) ;
44+ } ,
45+ 3 * 60 * 1000
46+ ) ;
You can’t perform that action at this time.
0 commit comments