@@ -79,7 +79,7 @@ func TestGetSbomScanCommandAndArgs(t *testing.T) {
7979 serverUrl : "" ,
8080 resultFileName : "result_output.json" ,
8181 compressedLogs : "true" ,
82- wantArgs : []string {"-c" , "trivy --cache-dir /tmp/trivy/.cache sbom --format json /tmp/scan/bom.json --slow --skip-db-update --output /tmp/scan/result_output.json 2>/tmp/scan/result_output.json.log ; rc=$?; if [ $rc -eq 1 ]; then cat /tmp/scan/result_output.json.log; else bzip2 -c /tmp/scan/result_output.json | base64; fi; exit $rc" },
82+ wantArgs : []string {"-c" , "trivy --cache-dir /tmp/trivy/.cache sbom --format json /tmp/scan/bom.json --slow --skip-db-update --output /tmp/scan/result_output.json 2>/tmp/scan/result_output.json.log ; rc=$?; if [ $rc -eq 1 ]; then cat /tmp/scan/result_output.json.log && sync ; else bzip2 -c /tmp/scan/result_output.json | base64 && sync ; fi; exit $rc" },
8383 wantCmd : []string {"/bin/sh" },
8484 },
8585 {
@@ -89,7 +89,7 @@ func TestGetSbomScanCommandAndArgs(t *testing.T) {
8989 serverUrl : "" ,
9090 resultFileName : "result_output.json" ,
9191 compressedLogs : "false" ,
92- wantArgs : []string {"-c" , "trivy --cache-dir /tmp/trivy/.cache sbom --format json /tmp/scan/bom.json --slow --skip-db-update --output /tmp/scan/result_output.json 2>/tmp/scan/result_output.json.log ; rc=$?; if [ $rc -eq 1 ]; then cat /tmp/scan/result_output.json.log; else cat /tmp/scan/result_output.json; fi; exit $rc" },
92+ wantArgs : []string {"-c" , "trivy --cache-dir /tmp/trivy/.cache sbom --format json /tmp/scan/bom.json --slow --skip-db-update --output /tmp/scan/result_output.json 2>/tmp/scan/result_output.json.log ; rc=$?; if [ $rc -eq 1 ]; then cat /tmp/scan/result_output.json.log && sync ; else cat /tmp/scan/result_output.json && sync ; fi; exit $rc" },
9393 wantCmd : []string {"/bin/sh" },
9494 },
9595 {
@@ -99,7 +99,7 @@ func TestGetSbomScanCommandAndArgs(t *testing.T) {
9999 serverUrl : "http://trivy-server:8080" ,
100100 resultFileName : "result_output.json" ,
101101 compressedLogs : "true" ,
102- wantArgs : []string {"-c" , "trivy --cache-dir /tmp/trivy/.cache sbom --format json --server http://trivy-server:8080 /tmp/scan/bom.json --slow --output /tmp/scan/result_output.json 2>/tmp/scan/result_output.json.log ; rc=$?; if [ $rc -eq 1 ]; then cat /tmp/scan/result_output.json.log; else bzip2 -c /tmp/scan/result_output.json | base64; fi; exit $rc" },
102+ wantArgs : []string {"-c" , "trivy --cache-dir /tmp/trivy/.cache sbom --format json --server http://trivy-server:8080 /tmp/scan/bom.json --slow --output /tmp/scan/result_output.json 2>/tmp/scan/result_output.json.log ; rc=$?; if [ $rc -eq 1 ]; then cat /tmp/scan/result_output.json.log && sync ; else bzip2 -c /tmp/scan/result_output.json | base64 && sync ; fi; exit $rc" },
103103 wantCmd : []string {"/bin/sh" },
104104 },
105105 {
@@ -109,7 +109,7 @@ func TestGetSbomScanCommandAndArgs(t *testing.T) {
109109 serverUrl : "http://trivy-server:8080" ,
110110 resultFileName : "result_output.json" ,
111111 compressedLogs : "false" ,
112- wantArgs : []string {"-c" , "trivy --cache-dir /tmp/trivy/.cache sbom --format json --server http://trivy-server:8080 /tmp/scan/bom.json --slow --output /tmp/scan/result_output.json 2>/tmp/scan/result_output.json.log ; rc=$?; if [ $rc -eq 1 ]; then cat /tmp/scan/result_output.json.log; else cat /tmp/scan/result_output.json; fi; exit $rc" },
112+ wantArgs : []string {"-c" , "trivy --cache-dir /tmp/trivy/.cache sbom --format json --server http://trivy-server:8080 /tmp/scan/bom.json --slow --output /tmp/scan/result_output.json 2>/tmp/scan/result_output.json.log ; rc=$?; if [ $rc -eq 1 ]; then cat /tmp/scan/result_output.json.log && sync ; else cat /tmp/scan/result_output.json && sync ; fi; exit $rc" },
113113 wantCmd : []string {"/bin/sh" },
114114 },
115115 }
0 commit comments