Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ppc64le architecture #724

Merged
merged 1 commit into from
Oct 27, 2020
Merged

Add support for ppc64le architecture #724

merged 1 commit into from
Oct 27, 2020

Conversation

carlosedp
Copy link
Contributor

Add binary building for the ppc64le (Power) architecture.

@CLAassistant
Copy link

CLAassistant commented Oct 26, 2020

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Oct 26, 2020

Codecov Report

Merging #724 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #724   +/-   ##
=======================================
  Coverage   63.90%   63.90%           
=======================================
  Files          48       48           
  Lines        2042     2042           
=======================================
  Hits         1305     1305           
  Misses        605      605           
  Partials      132      132           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d7784f...3d8341b. Read the comment docs.

@simar7 simar7 self-requested a review October 26, 2020 23:40
Copy link
Member

@simar7 simar7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - @carlosedp are you using Trivy on ppc64le? I don't have a machine to test a ppc64le built trivy binary. Have you tried building and running it locally on a ppc64le device?

@carlosedp
Copy link
Contributor Author

Hi @simar7, thanks for accepting the PR. Yes, I've used it on a ppc64le (Power9) host as part of the port for k3s (as it depends on trivy).

Here are some outputs:

❯ uname -a
Linux debian-blackbird 5.9.1 #1 SMP Mon Oct 26 15:10:46 -03 2020 ppc64le GNU/Linux

❯ trivy --version
Version: dev
Vulnerability DB:
  Type: Light
  Version: 1
  UpdatedAt: 2020-10-26 12:20:57.648087129 +0000 UTC


❯ trivy carlosedp/oauth2-proxy:v7.0.0
2020-10-26T20:49:11.191-0300	INFO	Detecting Alpine vulnerabilities...

carlosedp/oauth2-proxy:v7.0.0 (alpine 3.12.0)
=============================================
Total: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)

❯ trivy carlosedp/keycloak:v11.0.2
2020-10-26T20:50:36.470-0300	WARN	No OS package is detected. Make sure you haven't deleted any files that contain information about the installed packages.
2020-10-26T20:50:36.471-0300	WARN	e.g. files under "/lib/apk/db/", "/var/lib/dpkg/" and "/var/lib/rpm"
2020-10-26T20:50:36.471-0300	INFO	Detecting RHEL/CentOS vulnerabilities...

carlosedp/keycloak:v11.0.2 (redhat 8.2)
=======================================
Total: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)

And one with some vulnerabilities (from Readme):

❯ trivy image knqyf263/vuln-image:1.2.3
2020-10-26T20:52:30.369-0300	INFO	Detecting Alpine vulnerabilities...
2020-10-26T20:52:30.375-0300	INFO	Detecting php vulnerabilities...
2020-10-26T20:52:30.382-0300	INFO	Detecting ruby vulnerabilities...
2020-10-26T20:52:30.409-0300	INFO	Detecting nodejs vulnerabilities...
2020-10-26T20:52:30.418-0300	INFO	Detecting python vulnerabilities...
2020-10-26T20:52:30.435-0300	INFO	Detecting rust vulnerabilities...
2020-10-26T20:52:30.437-0300	WARN	This OS version is no longer supported by the distribution: alpine 3.7.1
2020-10-26T20:52:30.437-0300	WARN	The vulnerability detection may be insufficient because security updates are not provided

knqyf263/vuln-image:1.2.3 (alpine 3.7.1)
========================================
Total: 76 (UNKNOWN: 0, LOW: 1, MEDIUM: 25, HIGH: 25, CRITICAL: 25)

+-----------------------+------------------+----------+-------------------+---------------+--------------------------------------------------------------+
|        LIBRARY        | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION |                            TITLE                             |
+-----------------------+------------------+----------+-------------------+---------------+--------------------------------------------------------------+
| curl                  | CVE-2018-14618   | CRITICAL | 7.61.0-r0         | 7.61.1-r0     | curl: NTLM password overflow                                 |
|                       |                  |          |                   |               | via integer overflow                                         |
+                       +------------------+          +                   +---------------+--------------------------------------------------------------+
|                       | CVE-2018-16839   |          |                   | 7.61.1-r1     | curl: Integer overflow leading                               |
|                       |                  |          |                   |               | to heap-based buffer overflow in                             |
|                       |                  |          |                   |               | Curl_sasl_create_plain_message()                             |
+                       +------------------+          +                   +               +--------------------------------------------------------------+
|                       | CVE-2018-16840   |          |                   |               | curl: Use-after-free when                                    |
|                       |                  |          |                   |               | closing "easy" handle in                                     |
|                       |                  |          |                   |               | Curl_close()                                                 |
+                       +------------------+          +                   +               +--------------------------------------------------------------+
|                       | CVE-2018-16842   |          |                   |               | curl: Heap-based buffer                                      |
|                       |                  |          |                   |               | over-read in the curl tool                                   |
|                       |                  |          |                   |               | warning formatting                                           |
+                       +------------------+          +                   +---------------+--------------------------------------------------------------+
|                       | CVE-2019-3822    |          |                   | 7.61.1-r2     | curl: NTLMv2 type-3 header                                   |
|                       |                  |          |                   |               | stack buffer overflow                                        |
+                       +------------------+          +                   +---------------+--------------------------------------------------------------+
|                       | CVE-2019-5481    |          |                   | 7.61.1-r3     | curl: double free due to                                     |
|                       |                  |          |                   |               | subsequent call of realloc()                                 |
+                       +------------------+          +                   +               +--------------------------------------------------------------+
|                       | CVE-2019-5482    |          |                   |               | curl: heap buffer overflow in                                |
|                       |                  |          |                   |               | function tftp_receive_packet()                               |
+                       +------------------+----------+                   +---------------+--------------------------------------------------------------+
|                       | CVE-2018-16890   | HIGH     |                   | 7.61.1-r2     | curl: NTLM type-2 heap                                       |
|                       |                  |          |                   |               | out-of-bounds buffer read                                    |
+                       +------------------+          +                   +               +--------------------------------------------------------------+
|                       | CVE-2019-3823    |          |                   |               | curl: SMTP end-of-response                                   |
|                       |                  |          |                   |               | out-of-bounds read                                           |
+-----------------------+------------------+          +-------------------+---------------+--------------------------------------------------------------+
| expat                 | CVE-2018-20843   |          | 2.2.5-r0          | 2.2.7-r0      | expat: large number of colons                                |
|                       |                  |          |                   |               | in input makes parser consume                                |
|                       |                  |          |                   |               | high amount...                                               |
+                       +------------------+          +                   +---------------+--------------------------------------------------------------+
|                       | CVE-2019-15903   |          |                   | 2.2.7-r1      | expat: heap-based buffer                                     |
|                       |                  |          |                   |               | over-read via crafted XML                                    |
|                       |                  |          |                   |               | input                                                        |
+-----------------------+------------------+----------+-------------------+---------------+--------------------------------------------------------------+
| git                   | CVE-2018-17456   | CRITICAL | 2.15.2-r0         | 2.15.3-r0     | git: arbitrary code execution                                |
|                       |                  |          |                   |               | via .gitmodules                                              |
+                       +------------------+          +                   +               +--------------------------------------------------------------+
|                       | CVE-2018-19486   |          |                   |               | git: Improper handling of                                    |
|                       |                  |          |                   |               | PATH allows for commands to be                               |
|                       |                  |          |                   |               | executed from...                                             |
...

Also the tests:

❯ make test  
go test -v -short -coverprofile=coverage.txt -covermode=atomic ./...
go: downloading github.com/kylelemons/godebug v1.1.0
?   	github.com/aquasecurity/trivy/cmd/trivy	[no test files]
?   	github.com/aquasecurity/trivy/integration/docker	[no test files]
=== RUN   Test_showVersion
=== RUN   Test_showVersion/happy_path,_table_output
=== RUN   Test_showVersion/happy_path,_JSON_output
=== RUN   Test_showVersion/sad_path,_no_DB_is_available
=== RUN   Test_showVersion/sad_path,_bogus_cache_dir
--- PASS: Test_showVersion (0.00s)
    --- PASS: Test_showVersion/happy_path,_table_output (0.00s)
    --- PASS: Test_showVersion/happy_path,_JSON_output (0.00s)
    --- PASS: Test_showVersion/sad_path,_no_DB_is_available (0.00s)
    --- PASS: Test_showVersion/sad_path,_bogus_cache_dir (0.00s)
PASS
coverage: 26.9% of statements
ok  	github.com/aquasecurity/trivy/internal	0.105s	coverage: 26.9% of statements
?   	github.com/aquasecurity/trivy/internal/artifact	[no test files]
=== RUN   TestConfig_Init
=== RUN   TestConfig_Init/happy_path
=== RUN   TestConfig_Init/happy_path:_reset
=== RUN   TestConfig_Init/happy_path_with_an_unknown_severity
=== RUN   TestConfig_Init/deprecated_options
=== RUN   TestConfig_Init/invalid_option_combination:_--template_enabled_without_--format
=== RUN   TestConfig_Init/invalid_option_combination:_--template_and_--format_json
=== RUN   TestConfig_Init/invalid_option_combination:_--format_template_without_--template
=== RUN   TestConfig_Init/with_latest_tag
=== RUN   TestConfig_Init/sad:_skip_and_download_db
=== RUN   TestConfig_Init/sad:_multiple_image_names
NAME:
   config.test - A new cli application

USAGE:
   config.test  [arguments...]
=== RUN   TestConfig_Init/sad:_no_image_name
NAME:
   config.test - A new cli application

USAGE:
   config.test  [arguments...]
=== RUN   TestConfig_Init/sad:_invalid_image_name
--- PASS: TestConfig_Init (0.00s)
    --- PASS: TestConfig_Init/happy_path (0.00s)
    --- PASS: TestConfig_Init/happy_path:_reset (0.00s)
    --- PASS: TestConfig_Init/happy_path_with_an_unknown_severity (0.00s)
    --- PASS: TestConfig_Init/deprecated_options (0.00s)
    --- PASS: TestConfig_Init/invalid_option_combination:_--template_enabled_without_--format (0.00s)
    --- PASS: TestConfig_Init/invalid_option_combination:_--template_and_--format_json (0.00s)
    --- PASS: TestConfig_Init/invalid_option_combination:_--format_template_without_--template (0.00s)
    --- PASS: TestConfig_Init/with_latest_tag (0.00s)
    --- PASS: TestConfig_Init/sad:_skip_and_download_db (0.00s)
    --- PASS: TestConfig_Init/sad:_multiple_image_names (0.00s)
    --- PASS: TestConfig_Init/sad:_no_image_name (0.00s)
    --- PASS: TestConfig_Init/sad:_invalid_image_name (0.00s)
PASS
coverage: 89.5% of statements
ok  	github.com/aquasecurity/trivy/internal/artifact/config	0.048s	coverage: 89.5% of statements
?   	github.com/aquasecurity/trivy/internal/client	[no test files]
=== RUN   TestConfig_Init
=== RUN   TestConfig_Init/happy_path
=== RUN   TestConfig_Init/happy_path_with_token_and_token_header
=== RUN   TestConfig_Init/happy_path_with_good_custom_headers
=== RUN   TestConfig_Init/happy_path_with_bad_custom_headers
=== RUN   TestConfig_Init/happy_path_with_an_unknown_severity
=== RUN   TestConfig_Init/invalid_option_combination:_--template_enabled_without_--format
=== RUN   TestConfig_Init/invalid_option_combination:_--template_and_--format_json
=== RUN   TestConfig_Init/invalid_option_combination:_--format_template_without_--template
=== RUN   TestConfig_Init/invalid_option_combination:_--format_template_without_--template#01
=== RUN   TestConfig_Init/with_latest_tag
=== RUN   TestConfig_Init/sad:_multiple_image_names
=== RUN   TestConfig_Init/sad:_no_image_name
=== RUN   TestConfig_Init/sad:_invalid_image_name
NAME:
   config.test - A new cli application

USAGE:
   config.test  [arguments...]
--- PASS: TestConfig_Init (0.00s)
    --- PASS: TestConfig_Init/happy_path (0.00s)
    --- PASS: TestConfig_Init/happy_path_with_token_and_token_header (0.00s)
    --- PASS: TestConfig_Init/happy_path_with_good_custom_headers (0.00s)
    --- PASS: TestConfig_Init/happy_path_with_bad_custom_headers (0.00s)
    --- PASS: TestConfig_Init/happy_path_with_an_unknown_severity (0.00s)
    --- PASS: TestConfig_Init/invalid_option_combination:_--template_enabled_without_--format (0.00s)
    --- PASS: TestConfig_Init/invalid_option_combination:_--template_and_--format_json (0.00s)
    --- PASS: TestConfig_Init/invalid_option_combination:_--format_template_without_--template (0.00s)
    --- PASS: TestConfig_Init/invalid_option_combination:_--format_template_without_--template#01 (0.00s)
    --- PASS: TestConfig_Init/with_latest_tag (0.00s)
    --- PASS: TestConfig_Init/sad:_multiple_image_names (0.00s)
    --- PASS: TestConfig_Init/sad:_no_image_name (0.00s)
    --- PASS: TestConfig_Init/sad:_invalid_image_name (0.00s)
=== RUN   Test_splitCustomHeaders
=== RUN   Test_splitCustomHeaders/happy_path
--- PASS: Test_splitCustomHeaders (0.00s)
    --- PASS: Test_splitCustomHeaders/happy_path (0.00s)
PASS
coverage: 87.5% of statements
ok  	github.com/aquasecurity/trivy/internal/client/config	0.035s	coverage: 87.5% of statements
=== RUN   TestReportReportConfig_Init
=== RUN   TestReportReportConfig_Init/happy_path
=== RUN   TestReportReportConfig_Init/happy_path_with_an_unknown_severity
=== RUN   TestReportReportConfig_Init/invalid_option_combination:_--template_enabled_without_--format
=== RUN   TestReportReportConfig_Init/invalid_option_combination:_--template_and_--format_json
=== RUN   TestReportReportConfig_Init/invalid_option_combination:_--format_template_without_--template
--- PASS: TestReportReportConfig_Init (0.00s)
    --- PASS: TestReportReportConfig_Init/happy_path (0.00s)
    --- PASS: TestReportReportConfig_Init/happy_path_with_an_unknown_severity (0.00s)
    --- PASS: TestReportReportConfig_Init/invalid_option_combination:_--template_enabled_without_--format (0.00s)
    --- PASS: TestReportReportConfig_Init/invalid_option_combination:_--template_and_--format_json (0.00s)
    --- PASS: TestReportReportConfig_Init/invalid_option_combination:_--format_template_without_--template (0.00s)
=== RUN   TestArtifactConfig_Init
=== RUN   TestArtifactConfig_Init/happy_path
=== RUN   TestArtifactConfig_Init/sad:_multiple_image_names
=== RUN   TestArtifactConfig_Init/sad:_no_image_name
--- PASS: TestArtifactConfig_Init (0.00s)
    --- PASS: TestArtifactConfig_Init/happy_path (0.00s)
    --- PASS: TestArtifactConfig_Init/sad:_multiple_image_names (0.00s)
    --- PASS: TestArtifactConfig_Init/sad:_no_image_name (0.00s)
=== RUN   TestNewDBConfig
=== RUN   TestNewDBConfig/happy_path
--- PASS: TestNewDBConfig (0.00s)
    --- PASS: TestNewDBConfig/happy_path (0.00s)
=== RUN   TestDBConfig_Init
=== RUN   TestDBConfig_Init/happy_path
=== RUN   TestDBConfig_Init/sad_path
--- PASS: TestDBConfig_Init (0.00s)
    --- PASS: TestDBConfig_Init/happy_path (0.00s)
    --- PASS: TestDBConfig_Init/sad_path (0.00s)
=== RUN   TestNewGlobalConfig
=== RUN   TestNewGlobalConfig/happy_path
--- PASS: TestNewGlobalConfig (0.00s)
    --- PASS: TestNewGlobalConfig/happy_path (0.00s)
=== RUN   TestImageConfig_Init
=== RUN   TestImageConfig_Init/happy_path
=== RUN   TestImageConfig_Init/with_latest_tag
=== RUN   TestImageConfig_Init/sad:_invalid_image_name
--- PASS: TestImageConfig_Init (0.00s)
    --- PASS: TestImageConfig_Init/happy_path (0.00s)
    --- PASS: TestImageConfig_Init/with_latest_tag (0.00s)
    --- PASS: TestImageConfig_Init/sad:_invalid_image_name (0.00s)
PASS
coverage: 91.1% of statements
ok  	github.com/aquasecurity/trivy/internal/config	0.020s	coverage: 91.1% of statements
?   	github.com/aquasecurity/trivy/internal/operation	[no test files]
?   	github.com/aquasecurity/trivy/internal/server	[no test files]
=== RUN   TestNew
=== RUN   TestNew/happy_path
--- PASS: TestNew (0.00s)
    --- PASS: TestNew/happy_path (0.00s)
=== RUN   TestConfig_Init
=== RUN   TestConfig_Init/happy_path
=== RUN   TestConfig_Init/happy_path:_reset
=== RUN   TestConfig_Init/sad:_skip_and_download_db
--- PASS: TestConfig_Init (0.00s)
    --- PASS: TestConfig_Init/happy_path (0.00s)
    --- PASS: TestConfig_Init/happy_path:_reset (0.00s)
    --- PASS: TestConfig_Init/sad:_skip_and_download_db (0.00s)
PASS
coverage: 100.0% of statements
ok  	github.com/aquasecurity/trivy/internal/server/config	0.027s	coverage: 100.0% of statements
?   	github.com/aquasecurity/trivy/misc/eol	[no test files]
=== RUN   TestRemoteCache_PutArtifact
=== RUN   TestRemoteCache_PutArtifact/happy_path
=== RUN   TestRemoteCache_PutArtifact/sad_path
=== RUN   TestRemoteCache_PutArtifact/sad_path:_invalid_token
--- PASS: TestRemoteCache_PutArtifact (0.00s)
    --- PASS: TestRemoteCache_PutArtifact/happy_path (0.00s)
    --- PASS: TestRemoteCache_PutArtifact/sad_path (0.00s)
    --- PASS: TestRemoteCache_PutArtifact/sad_path:_invalid_token (0.00s)
=== RUN   TestRemoteCache_PutBlob
=== RUN   TestRemoteCache_PutBlob/happy_path
=== RUN   TestRemoteCache_PutBlob/sad_path
=== RUN   TestRemoteCache_PutBlob/sad_path:_invalid_token
--- PASS: TestRemoteCache_PutBlob (0.00s)
    --- PASS: TestRemoteCache_PutBlob/happy_path (0.00s)
    --- PASS: TestRemoteCache_PutBlob/sad_path (0.00s)
    --- PASS: TestRemoteCache_PutBlob/sad_path:_invalid_token (0.00s)
=== RUN   TestRemoteCache_MissingBlobs
=== RUN   TestRemoteCache_MissingBlobs/happy_path
=== RUN   TestRemoteCache_MissingBlobs/sad_path
=== RUN   TestRemoteCache_MissingBlobs/sad_path_with_invalid_token
--- PASS: TestRemoteCache_MissingBlobs (0.00s)
    --- PASS: TestRemoteCache_MissingBlobs/happy_path (0.00s)
    --- PASS: TestRemoteCache_MissingBlobs/sad_path (0.00s)
    --- PASS: TestRemoteCache_MissingBlobs/sad_path_with_invalid_token (0.00s)
PASS
coverage: 100.0% of statements
ok  	github.com/aquasecurity/trivy/pkg/cache	0.042s	coverage: 100.0% of statements
=== RUN   TestClient_NeedsUpdate
=== RUN   TestClient_NeedsUpdate/happy_path
=== RUN   TestClient_NeedsUpdate/happy_path_for_first_run
=== RUN   TestClient_NeedsUpdate/happy_path_with_different_type
=== RUN   TestClient_NeedsUpdate/happy_path_with_old_schema_version
=== RUN   TestClient_NeedsUpdate/happy_path_with_--skip-update
=== RUN   TestClient_NeedsUpdate/skip_downloading_DB
=== RUN   TestClient_NeedsUpdate/newer_schema_version
2020-10-26T20:54:20.151-0300	ERROR	Trivy version (test) is old. Update to the latest version.
=== RUN   TestClient_NeedsUpdate/--skip-update_on_the_first_run
2020-10-26T20:54:20.151-0300	ERROR	The first run cannot skip downloading DB
=== RUN   TestClient_NeedsUpdate/--skip-update_with_different_schema_version
2020-10-26T20:54:20.151-0300	ERROR	The local DB is old and needs to be updated
--- PASS: TestClient_NeedsUpdate (0.00s)
    --- PASS: TestClient_NeedsUpdate/happy_path (0.00s)
    --- PASS: TestClient_NeedsUpdate/happy_path_for_first_run (0.00s)
    --- PASS: TestClient_NeedsUpdate/happy_path_with_different_type (0.00s)
    --- PASS: TestClient_NeedsUpdate/happy_path_with_old_schema_version (0.00s)
    --- PASS: TestClient_NeedsUpdate/happy_path_with_--skip-update (0.00s)
    --- PASS: TestClient_NeedsUpdate/skip_downloading_DB (0.00s)
    --- PASS: TestClient_NeedsUpdate/newer_schema_version (0.00s)
    --- PASS: TestClient_NeedsUpdate/--skip-update_on_the_first_run (0.00s)
    --- PASS: TestClient_NeedsUpdate/--skip-update_with_different_schema_version (0.00s)
=== RUN   TestClient_Download
=== RUN   TestClient_Download/happy_path
    TestClient_Download/happy_path: db_test.go:249: PASS:	DownloadDB(string,string)
=== RUN   TestClient_Download/DownloadDB_returns_an_error
    TestClient_Download/DownloadDB_returns_an_error: db_test.go:249: PASS:	DownloadDB(string,string)
=== RUN   TestClient_Download/invalid_gzip
    TestClient_Download/invalid_gzip: db_test.go:249: PASS:	DownloadDB(string,string)
--- PASS: TestClient_Download (0.00s)
    --- PASS: TestClient_Download/happy_path (0.00s)
    --- PASS: TestClient_Download/DownloadDB_returns_an_error (0.00s)
    --- PASS: TestClient_Download/invalid_gzip (0.00s)
=== RUN   TestClient_UpdateMetadata
=== RUN   TestClient_UpdateMetadata/happy_path
=== RUN   TestClient_UpdateMetadata/sad_path,_get_metadata_fails
=== RUN   TestClient_UpdateMetadata/sad_path,_store_metadata_fails
--- PASS: TestClient_UpdateMetadata (0.01s)
    --- PASS: TestClient_UpdateMetadata/happy_path (0.00s)
    --- PASS: TestClient_UpdateMetadata/sad_path,_get_metadata_fails (0.00s)
    --- PASS: TestClient_UpdateMetadata/sad_path,_store_metadata_fails (0.00s)
PASS
coverage: 53.8% of statements
ok  	github.com/aquasecurity/trivy/pkg/db	0.022s	coverage: 53.8% of statements
=== RUN   TestAdvisory_DetectVulnerabilities
=== RUN   TestAdvisory_DetectVulnerabilities/happy_path
=== RUN   TestAdvisory_DetectVulnerabilities/no_patched_versions_in_the_advisory
=== RUN   TestAdvisory_DetectVulnerabilities/no_vulnerable_versions_in_the_advisory
=== RUN   TestAdvisory_DetectVulnerabilities/no_vulnerability
--- PASS: TestAdvisory_DetectVulnerabilities (0.05s)
    --- PASS: TestAdvisory_DetectVulnerabilities/happy_path (0.02s)
    --- PASS: TestAdvisory_DetectVulnerabilities/no_patched_versions_in_the_advisory (0.01s)
    --- PASS: TestAdvisory_DetectVulnerabilities/no_vulnerable_versions_in_the_advisory (0.00s)
    --- PASS: TestAdvisory_DetectVulnerabilities/no_vulnerability (0.02s)
=== RUN   TestDriver_Detect
=== RUN   TestDriver_Detect/happy_path
=== RUN   TestDriver_Detect/non-prefix_buckets
=== RUN   TestDriver_Detect/no_patched_versions_in_the_advisory
=== RUN   TestDriver_Detect/no_vulnerable_versions_in_the_advisory
=== RUN   TestDriver_Detect/no_vulnerability
--- PASS: TestDriver_Detect (0.03s)
    --- PASS: TestDriver_Detect/happy_path (0.01s)
    --- PASS: TestDriver_Detect/non-prefix_buckets (0.01s)
    --- PASS: TestDriver_Detect/no_patched_versions_in_the_advisory (0.01s)
    --- PASS: TestDriver_Detect/no_vulnerable_versions_in_the_advisory (0.01s)
    --- PASS: TestDriver_Detect/no_vulnerability (0.01s)
PASS
coverage: 42.1% of statements
ok  	github.com/aquasecurity/trivy/pkg/detector/library	0.111s	coverage: 42.1% of statements
=== RUN   TestScanner_Detect
=== RUN   TestScanner_Detect/Issue_#108
--- PASS: TestScanner_Detect (0.00s)
    --- PASS: TestScanner_Detect/Issue_#108 (0.00s)
PASS
coverage: 76.9% of statements
ok  	github.com/aquasecurity/trivy/pkg/detector/library/bundler	0.017s	coverage: 76.9% of statements
?   	github.com/aquasecurity/trivy/pkg/detector/library/cargo	[no test files]
?   	github.com/aquasecurity/trivy/pkg/detector/library/composer	[no test files]
?   	github.com/aquasecurity/trivy/pkg/detector/library/ghsa	[no test files]
?   	github.com/aquasecurity/trivy/pkg/detector/library/node	[no test files]
?   	github.com/aquasecurity/trivy/pkg/detector/library/python	[no test files]
?   	github.com/aquasecurity/trivy/pkg/detector/ospkg	[no test files]
=== RUN   TestScanner_Detect
=== RUN   TestScanner_Detect/happy_path
2020-10-26T20:54:20.016-0300	INFO	Detecting Alpine vulnerabilities...
=== RUN   TestScanner_Detect/contain_rc
2020-10-26T20:54:20.017-0300	INFO	Detecting Alpine vulnerabilities...
=== RUN   TestScanner_Detect/contain_pre
2020-10-26T20:54:20.017-0300	INFO	Detecting Alpine vulnerabilities...
=== RUN   TestScanner_Detect/Get_returns_an_error
2020-10-26T20:54:20.017-0300	INFO	Detecting Alpine vulnerabilities...
--- PASS: TestScanner_Detect (0.00s)
    --- PASS: TestScanner_Detect/happy_path (0.00s)
    --- PASS: TestScanner_Detect/contain_rc (0.00s)
    --- PASS: TestScanner_Detect/contain_pre (0.00s)
    --- PASS: TestScanner_Detect/Get_returns_an_error (0.00s)
=== RUN   TestScanner_IsSupportedVersion
=== RUN   TestScanner_IsSupportedVersion/unknown
2020-10-26T20:54:20.017-0300	WARN	This OS version is not on the EOL list: alpine unknown
=== RUN   TestScanner_IsSupportedVersion/alpine3.6
=== RUN   TestScanner_IsSupportedVersion/alpine3.6_with_EOL
=== RUN   TestScanner_IsSupportedVersion/alpine3.9
=== RUN   TestScanner_IsSupportedVersion/alpine3.10
--- PASS: TestScanner_IsSupportedVersion (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/unknown (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/alpine3.6 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/alpine3.6_with_EOL (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/alpine3.9 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/alpine3.10 (0.00s)
PASS
coverage: 94.1% of statements
ok  	github.com/aquasecurity/trivy/pkg/detector/ospkg/alpine	0.035s	coverage: 94.1% of statements
=== RUN   TestScanner_Detect
=== RUN   TestScanner_Detect/happy_path
=== RUN   TestScanner_Detect/get_vulnerabilities_fails_to_fetch
2020-10-26T20:54:20.129-0300	INFO	Detecting Amazon Linux vulnerabilities...
2020-10-26T20:54:20.129-0300	DEBUG	amazon: os version: 1
2020-10-26T20:54:20.129-0300	DEBUG	amazon: the number of packages: 1
=== RUN   TestScanner_Detect/invalid_installed_package_version
=== RUN   TestScanner_Detect/invalid_fixed_package_version
--- PASS: TestScanner_Detect (0.00s)
    --- PASS: TestScanner_Detect/happy_path (0.00s)
    --- PASS: TestScanner_Detect/get_vulnerabilities_fails_to_fetch (0.00s)
    --- PASS: TestScanner_Detect/invalid_installed_package_version (0.00s)
    --- PASS: TestScanner_Detect/invalid_fixed_package_version (0.00s)
PASS
coverage: 93.1% of statements
ok  	github.com/aquasecurity/trivy/pkg/detector/ospkg/amazon	0.042s	coverage: 93.1% of statements
=== RUN   TestScanner_IsSupportedVersion
=== RUN   TestScanner_IsSupportedVersion/unknown
2020-10-26T20:54:19.992-0300	WARN	This OS version is not on the EOL list: debian unknown
=== RUN   TestScanner_IsSupportedVersion/debian7
=== RUN   TestScanner_IsSupportedVersion/debian8
=== RUN   TestScanner_IsSupportedVersion/debian8_eol_ends
=== RUN   TestScanner_IsSupportedVersion/debian9
--- PASS: TestScanner_IsSupportedVersion (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/unknown (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/debian7 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/debian8 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/debian8_eol_ends (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/debian9 (0.00s)
=== RUN   TestScanner_Detect
=== RUN   TestScanner_Detect/happy_path
2020-10-26T20:54:19.993-0300	INFO	Detecting Debian vulnerabilities...
--- PASS: TestScanner_Detect (0.00s)
    --- PASS: TestScanner_Detect/happy_path (0.00s)
PASS
coverage: 85.0% of statements
ok  	github.com/aquasecurity/trivy/pkg/detector/ospkg/debian	0.019s	coverage: 85.0% of statements
=== RUN   TestScanner_IsSupportedVersion
=== RUN   TestScanner_IsSupportedVersion/oracle3
=== RUN   TestScanner_IsSupportedVersion/oracle4
=== RUN   TestScanner_IsSupportedVersion/oracle5
=== RUN   TestScanner_IsSupportedVersion/oracle8
=== RUN   TestScanner_IsSupportedVersion/oracle8-same-time
=== RUN   TestScanner_IsSupportedVersion/oracle6
=== RUN   TestScanner_IsSupportedVersion/oracle7
=== RUN   TestScanner_IsSupportedVersion/oracle7.6
=== RUN   TestScanner_IsSupportedVersion/unknown
2020-10-26T20:54:20.074-0300	WARN	This OS version is not on the EOL list: oracle unknown
--- PASS: TestScanner_IsSupportedVersion (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/oracle3 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/oracle4 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/oracle5 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/oracle8 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/oracle8-same-time (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/oracle6 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/oracle7 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/oracle7.6 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/unknown (0.00s)
=== RUN   TestScanner_Detect
=== RUN   TestScanner_Detect/happy_path
2020-10-26T20:54:20.074-0300	INFO	Detecting Oracle Linux vulnerabilities...
--- PASS: TestScanner_Detect (0.00s)
    --- PASS: TestScanner_Detect/happy_path (0.00s)
PASS
coverage: 92.6% of statements
ok  	github.com/aquasecurity/trivy/pkg/detector/ospkg/oracle	0.026s	coverage: 92.6% of statements
=== RUN   TestScanner_Detect
=== RUN   TestScanner_Detect/happy_path
2020-10-26T20:54:20.033-0300	INFO	Detecting Photon Linux vulnerabilities...
--- PASS: TestScanner_Detect (0.00s)
    --- PASS: TestScanner_Detect/happy_path (0.00s)
PASS
coverage: 84.2% of statements
ok  	github.com/aquasecurity/trivy/pkg/detector/ospkg/photon	0.017s	coverage: 84.2% of statements
=== RUN   TestScanner_Detect
=== RUN   TestScanner_Detect/happy_path:_src_pkg_name_is_different_from_bin_pkg_name
2020-10-26T20:54:20.083-0300	INFO	Detecting RHEL/CentOS vulnerabilities...
=== RUN   TestScanner_Detect/happy_path:_src_pkg_name_is_the_same_as_bin_pkg_name
2020-10-26T20:54:20.084-0300	INFO	Detecting RHEL/CentOS vulnerabilities...
=== RUN   TestScanner_Detect/sad_path:_Get_returns_an_error
2020-10-26T20:54:20.084-0300	INFO	Detecting RHEL/CentOS vulnerabilities...
--- PASS: TestScanner_Detect (0.00s)
    --- PASS: TestScanner_Detect/happy_path:_src_pkg_name_is_different_from_bin_pkg_name (0.00s)
    --- PASS: TestScanner_Detect/happy_path:_src_pkg_name_is_the_same_as_bin_pkg_name (0.00s)
    --- PASS: TestScanner_Detect/sad_path:_Get_returns_an_error (0.00s)
=== RUN   TestScanner_IsSupportedVersion
=== RUN   TestScanner_IsSupportedVersion/centos6
=== RUN   TestScanner_IsSupportedVersion/centos8
=== RUN   TestScanner_IsSupportedVersion/redhat5
=== RUN   TestScanner_IsSupportedVersion/redhat6
=== RUN   TestScanner_IsSupportedVersion/redhat7
=== RUN   TestScanner_IsSupportedVersion/no_dot
=== RUN   TestScanner_IsSupportedVersion/centos5
=== RUN   TestScanner_IsSupportedVersion/centos6_(eol_ends)
=== RUN   TestScanner_IsSupportedVersion/centos7
=== RUN   TestScanner_IsSupportedVersion/two_dots
=== RUN   TestScanner_IsSupportedVersion/redhat6_(eol_ends)
=== RUN   TestScanner_IsSupportedVersion/redhat8
=== RUN   TestScanner_IsSupportedVersion/debian
2020-10-26T20:54:20.085-0300	WARN	This OS version is not on the EOL list: debian 8
--- PASS: TestScanner_IsSupportedVersion (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/centos6 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/centos8 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/redhat5 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/redhat6 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/redhat7 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/no_dot (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/centos5 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/centos6_(eol_ends) (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/centos7 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/two_dots (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/redhat6_(eol_ends) (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/redhat8 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/debian (0.00s)
PASS
coverage: 92.7% of statements
ok  	github.com/aquasecurity/trivy/pkg/detector/ospkg/redhat	0.013s	coverage: 92.7% of statements
=== RUN   TestScanner_IsSupportedVersion
=== RUN   TestScanner_IsSupportedVersion/opensuse.leap15.1-sametime
=== RUN   TestScanner_IsSupportedVersion/sles12.3
=== RUN   TestScanner_IsSupportedVersion/sles15
=== RUN   TestScanner_IsSupportedVersion/unknown
2020-10-26T20:54:23.050-0300	WARN	This OS version is not on the EOL list: oracle unknown
=== RUN   TestScanner_IsSupportedVersion/opensuse.leap42.3
=== RUN   TestScanner_IsSupportedVersion/opensuse.leap15
=== RUN   TestScanner_IsSupportedVersion/opensuse.leap15.1
--- PASS: TestScanner_IsSupportedVersion (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/opensuse.leap15.1-sametime (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/sles12.3 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/sles15 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/unknown (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/opensuse.leap42.3 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/opensuse.leap15 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/opensuse.leap15.1 (0.00s)
=== RUN   TestScanner_Detect
=== RUN   TestScanner_Detect/happy_path
2020-10-26T20:54:23.050-0300	INFO	Detecting SUSE vulnerabilities...
--- PASS: TestScanner_Detect (0.00s)
    --- PASS: TestScanner_Detect/happy_path (0.00s)
PASS
coverage: 83.9% of statements
ok  	github.com/aquasecurity/trivy/pkg/detector/ospkg/suse	0.057s	coverage: 83.9% of statements
=== RUN   TestScanner_IsSupportedVersion
=== RUN   TestScanner_IsSupportedVersion/ubuntu12.04_eol_ends
=== RUN   TestScanner_IsSupportedVersion/ubuntu12.04
=== RUN   TestScanner_IsSupportedVersion/ubuntu12.10
=== RUN   TestScanner_IsSupportedVersion/ubuntu18.04
=== RUN   TestScanner_IsSupportedVersion/ubuntu19.04
=== RUN   TestScanner_IsSupportedVersion/unknown
2020-10-26T20:54:23.099-0300	WARN	This OS version is not on the EOL list: ubuntu unknown
--- PASS: TestScanner_IsSupportedVersion (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/ubuntu12.04_eol_ends (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/ubuntu12.04 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/ubuntu12.10 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/ubuntu18.04 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/ubuntu19.04 (0.00s)
    --- PASS: TestScanner_IsSupportedVersion/unknown (0.00s)
=== RUN   TestScanner_Detect
=== RUN   TestScanner_Detect/happy_path
2020-10-26T20:54:23.100-0300	INFO	Detecting Ubuntu vulnerabilities...
--- PASS: TestScanner_Detect (0.00s)
    --- PASS: TestScanner_Detect/happy_path (0.00s)
PASS
coverage: 72.7% of statements
ok  	github.com/aquasecurity/trivy/pkg/detector/ospkg/ubuntu	0.021s	coverage: 72.7% of statements
=== RUN   TestClient_DownloadDB
=== RUN   TestClient_DownloadDB/happy_path
    TestClient_DownloadDB/happy_path: github_test.go:464: PASS:	ListReleases(string,string)
    TestClient_DownloadDB/happy_path: github_test.go:464: PASS:	DownloadAsset(string,int64)
=== RUN   TestClient_DownloadDB/happy_path_with_redirect_URL
    TestClient_DownloadDB/happy_path_with_redirect_URL: github_test.go:464: PASS:	ListReleases(string,string)
    TestClient_DownloadDB/happy_path_with_redirect_URL: github_test.go:464: PASS:	DownloadAsset(string,int64)
=== RUN   TestClient_DownloadDB/happy_path_with_inorder_releases
    TestClient_DownloadDB/happy_path_with_inorder_releases: github_test.go:464: PASS:	ListReleases(string,string)
    TestClient_DownloadDB/happy_path_with_inorder_releases: github_test.go:464: PASS:	DownloadAsset(string,int64)
=== RUN   TestClient_DownloadDB/happy_path_with_no_asset
    TestClient_DownloadDB/happy_path_with_no_asset: github_test.go:464: PASS:	ListReleases(string,string)
    TestClient_DownloadDB/happy_path_with_no_asset: github_test.go:464: PASS:	DownloadAsset(string,int64)
=== RUN   TestClient_DownloadDB/no_asset
    TestClient_DownloadDB/no_asset: github_test.go:464: PASS:	ListReleases(string,string)
=== RUN   TestClient_DownloadDB/the_file_name_doesn't_match
    TestClient_DownloadDB/the_file_name_doesn't_match: github_test.go:464: PASS:	ListReleases(string,string)
=== RUN   TestClient_DownloadDB/ListReleases_returns_error
    TestClient_DownloadDB/ListReleases_returns_error: github_test.go:464: PASS:	ListReleases(string,string)
=== RUN   TestClient_DownloadDB/DownloadAsset_returns_error
    TestClient_DownloadDB/DownloadAsset_returns_error: github_test.go:464: PASS:	ListReleases(string,string)
    TestClient_DownloadDB/DownloadAsset_returns_error: github_test.go:464: PASS:	DownloadAsset(string,int64)
=== RUN   TestClient_DownloadDB/404_error
    TestClient_DownloadDB/404_error: github_test.go:464: PASS:	ListReleases(string,string)
    TestClient_DownloadDB/404_error: github_test.go:464: PASS:	DownloadAsset(string,int64)
--- PASS: TestClient_DownloadDB (0.00s)
    --- PASS: TestClient_DownloadDB/happy_path (0.00s)
    --- PASS: TestClient_DownloadDB/happy_path_with_redirect_URL (0.00s)
    --- PASS: TestClient_DownloadDB/happy_path_with_inorder_releases (0.00s)
    --- PASS: TestClient_DownloadDB/happy_path_with_no_asset (0.00s)
    --- PASS: TestClient_DownloadDB/no_asset (0.00s)
    --- PASS: TestClient_DownloadDB/the_file_name_doesn't_match (0.00s)
    --- PASS: TestClient_DownloadDB/ListReleases_returns_error (0.00s)
    --- PASS: TestClient_DownloadDB/DownloadAsset_returns_error (0.00s)
    --- PASS: TestClient_DownloadDB/404_error (0.00s)
PASS
coverage: 50.0% of statements
ok  	github.com/aquasecurity/trivy/pkg/github	0.016s	coverage: 50.0% of statements
?   	github.com/aquasecurity/trivy/pkg/indicator	[no test files]
?   	github.com/aquasecurity/trivy/pkg/log	[no test files]
=== RUN   TestReportWriter_Table
=== RUN   TestReportWriter_Table/happy_path_full

foo
===
Total: 1 ()

=== RUN   TestReportWriter_Table/happy_path_light

foo
===
Total: 1 ()

=== RUN   TestReportWriter_Table/no_title_for_vuln

foo
===
Total: 1 ()

=== RUN   TestReportWriter_Table/long_title_for_vuln

foo
===
Total: 1 ()

=== RUN   TestReportWriter_Table/no_vulns

foo
===
Total: 0 ()

--- PASS: TestReportWriter_Table (0.00s)
    --- PASS: TestReportWriter_Table/happy_path_full (0.00s)
    --- PASS: TestReportWriter_Table/happy_path_light (0.00s)
    --- PASS: TestReportWriter_Table/no_title_for_vuln (0.00s)
    --- PASS: TestReportWriter_Table/long_title_for_vuln (0.00s)
    --- PASS: TestReportWriter_Table/no_vulns (0.00s)
=== RUN   TestReportWriter_JSON
=== RUN   TestReportWriter_JSON/happy_path
--- PASS: TestReportWriter_JSON (0.00s)
    --- PASS: TestReportWriter_JSON/happy_path (0.00s)
=== RUN   TestReportWriter_Template
=== RUN   TestReportWriter_Template/happy_path
=== RUN   TestReportWriter_Template/happy_path#01
=== RUN   TestReportWriter_Template/happy_path_with/without_period_description_should_return_with_period
=== RUN   TestReportWriter_Template/happy_path:_env_var_parsing_and_getCurrentTime
--- PASS: TestReportWriter_Template (0.00s)
    --- PASS: TestReportWriter_Template/happy_path (0.00s)
    --- PASS: TestReportWriter_Template/happy_path#01 (0.00s)
    --- PASS: TestReportWriter_Template/happy_path_with/without_period_description_should_return_with_period (0.00s)
    --- PASS: TestReportWriter_Template/happy_path:_env_var_parsing_and_getCurrentTime (0.00s)
PASS
coverage: 79.8% of statements
ok  	github.com/aquasecurity/trivy/pkg/report	0.035s	coverage: 79.8% of statements
=== RUN   TestConvertToRpcPkgs
=== RUN   TestConvertToRpcPkgs/happy_path
--- PASS: TestConvertToRpcPkgs (0.00s)
    --- PASS: TestConvertToRpcPkgs/happy_path (0.00s)
=== RUN   TestConvertFromRpcPkgs
=== RUN   TestConvertFromRpcPkgs/#00
--- PASS: TestConvertFromRpcPkgs (0.00s)
    --- PASS: TestConvertFromRpcPkgs/#00 (0.00s)
=== RUN   TestConvertFromRpcLibraries
=== RUN   TestConvertFromRpcLibraries/happy_path
--- PASS: TestConvertFromRpcLibraries (0.00s)
    --- PASS: TestConvertFromRpcLibraries/happy_path (0.00s)
=== RUN   TestConvertToRpcLibraries
=== RUN   TestConvertToRpcLibraries/happy_path
--- PASS: TestConvertToRpcLibraries (0.00s)
    --- PASS: TestConvertToRpcLibraries/happy_path (0.00s)
=== RUN   TestConvertFromRpcVulns
=== RUN   TestConvertFromRpcVulns/happy_path
--- PASS: TestConvertFromRpcVulns (0.00s)
    --- PASS: TestConvertFromRpcVulns/happy_path (0.00s)
=== RUN   TestConvertToRpcVulns
=== RUN   TestConvertToRpcVulns/happy_path
=== RUN   TestConvertToRpcVulns/invalid_severity
2020-10-26T20:54:23.542-0300	WARN	unknown severity: INVALID
--- PASS: TestConvertToRpcVulns (0.00s)
    --- PASS: TestConvertToRpcVulns/happy_path (0.00s)
    --- PASS: TestConvertToRpcVulns/invalid_severity (0.00s)
PASS
coverage: 31.3% of statements
ok  	github.com/aquasecurity/trivy/pkg/rpc	0.011s	coverage: 31.3% of statements
=== RUN   TestScanner_Scan
=== RUN   TestScanner_Scan/happy_path
=== RUN   TestScanner_Scan/sad_path:_Scan_returns_an_error
--- PASS: TestScanner_Scan (0.00s)
    --- PASS: TestScanner_Scan/happy_path (0.00s)
    --- PASS: TestScanner_Scan/sad_path:_Scan_returns_an_error (0.00s)
=== RUN   TestWithCustomHeaders
--- PASS: TestWithCustomHeaders (0.00s)
PASS
coverage: 93.8% of statements
ok  	github.com/aquasecurity/trivy/pkg/rpc/client	0.010s	coverage: 93.8% of statements
=== RUN   Test_dbWorker_update
=== RUN   Test_dbWorker_update/happy_path
2020-10-26T20:54:27.574-0300	INFO	Updating DB...
2020-10-26T20:54:27.575-0300	INFO	Suspending all requests during DB update
2020-10-26T20:54:27.575-0300	INFO	Waiting for all requests to be processed before DB update...
2020-10-26T20:54:27.575-0300	INFO	Reopening DB...
    Test_dbWorker_update/happy_path: listen_test.go:158: PASS:	NeedsUpdate(string,bool,bool)
    Test_dbWorker_update/happy_path: listen_test.go:158: PASS:	UpdateMetadata(string)
    Test_dbWorker_update/happy_path: listen_test.go:158: PASS:	Download(string,string,bool)
=== RUN   Test_dbWorker_update/not_update
=== RUN   Test_dbWorker_update/NeedsUpdate_returns_an_error
=== RUN   Test_dbWorker_update/Download_returns_an_error
2020-10-26T20:54:27.617-0300	INFO	Updating DB...
--- PASS: Test_dbWorker_update (0.06s)
    --- PASS: Test_dbWorker_update/happy_path (0.02s)
    --- PASS: Test_dbWorker_update/not_update (0.01s)
    --- PASS: Test_dbWorker_update/NeedsUpdate_returns_an_error (0.03s)
    --- PASS: Test_dbWorker_update/Download_returns_an_error (0.01s)
=== RUN   TestScanServer_Scan
=== RUN   TestScanServer_Scan/happy_path
2020-10-26T20:54:27.618-0300	WARN	unknown severity: 
=== RUN   TestScanServer_Scan/sad_path:_Scan_returns_an_error
--- PASS: TestScanServer_Scan (0.00s)
    --- PASS: TestScanServer_Scan/happy_path (0.00s)
    --- PASS: TestScanServer_Scan/sad_path:_Scan_returns_an_error (0.00s)
=== RUN   TestCacheServer_PutArtifact
=== RUN   TestCacheServer_PutArtifact/happy_path
=== RUN   TestCacheServer_PutArtifact/sad_path
=== RUN   TestCacheServer_PutArtifact/sad_path:_empty_image_info
--- PASS: TestCacheServer_PutArtifact (0.00s)
    --- PASS: TestCacheServer_PutArtifact/happy_path (0.00s)
    --- PASS: TestCacheServer_PutArtifact/sad_path (0.00s)
    --- PASS: TestCacheServer_PutArtifact/sad_path:_empty_image_info (0.00s)
=== RUN   TestCacheServer_PutBlob
=== RUN   TestCacheServer_PutBlob/happy_path
=== RUN   TestCacheServer_PutBlob/sad_path
=== RUN   TestCacheServer_PutBlob/sad_path:_empty_layer_info
--- PASS: TestCacheServer_PutBlob (0.00s)
    --- PASS: TestCacheServer_PutBlob/happy_path (0.00s)
    --- PASS: TestCacheServer_PutBlob/sad_path (0.00s)
    --- PASS: TestCacheServer_PutBlob/sad_path:_empty_layer_info (0.00s)
=== RUN   TestCacheServer_MissingBlobs
=== RUN   TestCacheServer_MissingBlobs/happy_path
    TestCacheServer_MissingBlobs/happy_path: server_test.go:524: PASS:	MissingBlobs(string,[]string)
--- PASS: TestCacheServer_MissingBlobs (0.00s)
    --- PASS: TestCacheServer_MissingBlobs/happy_path (0.00s)
PASS
coverage: 43.6% of statements
ok  	github.com/aquasecurity/trivy/pkg/rpc/server	0.155s	coverage: 43.6% of statements
=== RUN   TestServer_Detect
=== RUN   TestServer_Detect/happy_path
    TestServer_Detect/happy_path: server_test.go:169: PASS:	Detect(string,string,time.Time,[]types.LibraryInfo)
    TestServer_Detect/happy_path: server_test.go:170: PASS:	FillInfo([]types.DetectedVulnerability,string)
=== RUN   TestServer_Detect/Detect_returns_an_error
2020-10-26T20:54:23.947-0300	ERROR	failed to detect library vulnerabilities: error
--- PASS: TestServer_Detect (0.00s)
    --- PASS: TestServer_Detect/happy_path (0.00s)
    --- PASS: TestServer_Detect/Detect_returns_an_error (0.00s)
PASS
coverage: 100.0% of statements
ok  	github.com/aquasecurity/trivy/pkg/rpc/server/library	0.007s	coverage: 100.0% of statements
=== RUN   TestServer_Detect
=== RUN   TestServer_Detect/happy_path
    TestServer_Detect/happy_path: server_test.go:151: PASS:	Detect(string,string,string,time.Time,[]types.Package)
    TestServer_Detect/happy_path: server_test.go:152: PASS:	FillInfo([]types.DetectedVulnerability,string)
=== RUN   TestServer_Detect/Detect_returns_an_error
2020-10-26T20:54:24.348-0300	ERROR	failed to detect vulnerabilities of OS packages: error
--- PASS: TestServer_Detect (0.00s)
    --- PASS: TestServer_Detect/happy_path (0.00s)
    --- PASS: TestServer_Detect/Detect_returns_an_error (0.00s)
PASS
coverage: 100.0% of statements
ok  	github.com/aquasecurity/trivy/pkg/rpc/server/ospkg	0.006s	coverage: 100.0% of statements
=== RUN   TestScanner_ScanArtifact
=== RUN   TestScanner_ScanArtifact/happy_path
2020-10-26T20:54:27.237-0300	WARN	This OS version is no longer supported by the distribution: alpine 3.10
2020-10-26T20:54:27.237-0300	WARN	The vulnerability detection may be insufficient because security updates are not provided
=== RUN   TestScanner_ScanArtifact/sad_path:_AnalyzerAnalyze_returns_an_error
=== RUN   TestScanner_ScanArtifact/sad_path:_Scan_returns_an_error
--- PASS: TestScanner_ScanArtifact (0.00s)
    --- PASS: TestScanner_ScanArtifact/happy_path (0.00s)
    --- PASS: TestScanner_ScanArtifact/sad_path:_AnalyzerAnalyze_returns_an_error (0.00s)
    --- PASS: TestScanner_ScanArtifact/sad_path:_Scan_returns_an_error (0.00s)
PASS
coverage: 79.6% of statements
ok  	github.com/aquasecurity/trivy/pkg/scanner	0.061s	coverage: 79.6% of statements
=== RUN   TestScanner_Scan
=== RUN   TestScanner_Scan/happy_path
    TestScanner_Scan/happy_path: scan_test.go:1075: PASS:	ApplyLayers(string,[]string)
    TestScanner_Scan/happy_path: scan_test.go:1076: PASS:	Detect(string,string,string,time.Time,[]types.Package)
    TestScanner_Scan/happy_path: scan_test.go:1077: PASS:	Detect(string,string,time.Time,[]types.LibraryInfo)
=== RUN   TestScanner_Scan/happy_path_with_list_all_packages
    TestScanner_Scan/happy_path_with_list_all_packages: scan_test.go:1075: PASS:	ApplyLayers(string,[]string)
    TestScanner_Scan/happy_path_with_list_all_packages: scan_test.go:1076: PASS:	Detect(string,string,string,time.Time,[]types.Package)
    TestScanner_Scan/happy_path_with_list_all_packages: scan_test.go:1077: PASS:	Detect(string,string,time.Time,[]types.LibraryInfo)
=== RUN   TestScanner_Scan/happy_path_with_empty_os
    TestScanner_Scan/happy_path_with_empty_os: scan_test.go:1075: PASS:	ApplyLayers(string,[]string)
    TestScanner_Scan/happy_path_with_empty_os: scan_test.go:1077: PASS:	Detect(string,string,time.Time,[]types.LibraryInfo)
=== RUN   TestScanner_Scan/happy_path_with_no_package
    TestScanner_Scan/happy_path_with_no_package: scan_test.go:1075: PASS:	ApplyLayers(string,[]string)
    TestScanner_Scan/happy_path_with_no_package: scan_test.go:1076: PASS:	Detect(string,string,string,time.Time,[]types.Package)
    TestScanner_Scan/happy_path_with_no_package: scan_test.go:1077: PASS:	Detect(string,string,time.Time,[]types.LibraryInfo)
=== RUN   TestScanner_Scan/happy_path_with_unsupported_os
    TestScanner_Scan/happy_path_with_unsupported_os: scan_test.go:1075: PASS:	ApplyLayers(string,[]string)
    TestScanner_Scan/happy_path_with_unsupported_os: scan_test.go:1076: PASS:	Detect(string,string,string,time.Time,[]types.Package)
    TestScanner_Scan/happy_path_with_unsupported_os: scan_test.go:1077: PASS:	Detect(string,string,time.Time,[]types.LibraryInfo)
=== RUN   TestScanner_Scan/happy_path_with_a_scratch_image
    TestScanner_Scan/happy_path_with_a_scratch_image: scan_test.go:1075: PASS:	ApplyLayers(string,[]string)
=== RUN   TestScanner_Scan/happy_path_with_only_library_detection
    TestScanner_Scan/happy_path_with_only_library_detection: scan_test.go:1075: PASS:	ApplyLayers(string,[]string)
    TestScanner_Scan/happy_path_with_only_library_detection: scan_test.go:1077: PASS:	Detect(string,string,time.Time,[]types.LibraryInfo)
    TestScanner_Scan/happy_path_with_only_library_detection: scan_test.go:1077: PASS:	Detect(string,string,time.Time,[]types.LibraryInfo)
=== RUN   TestScanner_Scan/happy_path_with_skip_directories
    TestScanner_Scan/happy_path_with_skip_directories: scan_test.go:1075: PASS:	ApplyLayers(string,[]string)
    TestScanner_Scan/happy_path_with_skip_directories: scan_test.go:1077: PASS:	Detect(string,string,time.Time,[]types.LibraryInfo)
    TestScanner_Scan/happy_path_with_skip_directories: scan_test.go:1077: PASS:	Detect(string,string,time.Time,[]types.LibraryInfo)
=== RUN   TestScanner_Scan/sad_path:_ApplyLayers_returns_an_error
=== RUN   TestScanner_Scan/sad_path:_ospkgDetector.Detect_returns_an_error
=== RUN   TestScanner_Scan/sad_path:_libDetector.Detect_returns_an_error
--- PASS: TestScanner_Scan (0.00s)
    --- PASS: TestScanner_Scan/happy_path (0.00s)
    --- PASS: TestScanner_Scan/happy_path_with_list_all_packages (0.00s)
    --- PASS: TestScanner_Scan/happy_path_with_empty_os (0.00s)
    --- PASS: TestScanner_Scan/happy_path_with_no_package (0.00s)
    --- PASS: TestScanner_Scan/happy_path_with_unsupported_os (0.00s)
    --- PASS: TestScanner_Scan/happy_path_with_a_scratch_image (0.00s)
    --- PASS: TestScanner_Scan/happy_path_with_only_library_detection (0.00s)
    --- PASS: TestScanner_Scan/happy_path_with_skip_directories (0.00s)
    --- PASS: TestScanner_Scan/sad_path:_ApplyLayers_returns_an_error (0.00s)
    --- PASS: TestScanner_Scan/sad_path:_ospkgDetector.Detect_returns_an_error (0.00s)
    --- PASS: TestScanner_Scan/sad_path:_libDetector.Detect_returns_an_error (0.00s)
=== RUN   Test_skipped
=== RUN   Test_skipped/no_skip_directory
=== RUN   Test_skipped/skip_directory_with_the_leading_slash
=== RUN   Test_skipped/skip_directory_without_a_slash
=== RUN   Test_skipped/not_skipped
--- PASS: Test_skipped (0.00s)
    --- PASS: Test_skipped/no_skip_directory (0.00s)
    --- PASS: Test_skipped/skip_directory_with_the_leading_slash (0.00s)
    --- PASS: Test_skipped/skip_directory_without_a_slash (0.00s)
    --- PASS: Test_skipped/not_skipped (0.00s)
PASS
coverage: 79.6% of statements
ok  	github.com/aquasecurity/trivy/pkg/scanner/local	0.012s	coverage: 79.6% of statements
=== RUN   TestMatchVersions
=== RUN   TestMatchVersions/pass:_expect_true_when_os/machine_is_in_version_string
=== RUN   TestMatchVersions/pass:_expect_true_when_language_is_in_version_string
=== RUN   TestMatchVersions/expect_false
=== RUN   TestMatchVersions/expect_false#01
=== RUN   TestMatchVersions/expect_false#02
=== RUN   TestMatchVersions/expect_false#03
=== RUN   TestMatchVersions/expect_false#04
=== RUN   TestMatchVersions/expect_false#05
=== RUN   TestMatchVersions/expect_false#06
=== RUN   TestMatchVersions/expect_prerelease_suffixed_in_minor_version_to_work
=== RUN   TestMatchVersions/expect_prerelease_suffixed_in_patch_version_to_work
=== RUN   TestMatchVersions/expect_prerelease_suffixed_in_patch_version_to_work_in_failing_case
=== RUN   TestMatchVersions/expect_double_equal_to_work
--- PASS: TestMatchVersions (0.00s)
    --- PASS: TestMatchVersions/pass:_expect_true_when_os/machine_is_in_version_string (0.00s)
    --- PASS: TestMatchVersions/pass:_expect_true_when_language_is_in_version_string (0.00s)
    --- PASS: TestMatchVersions/expect_false (0.00s)
    --- PASS: TestMatchVersions/expect_false#01 (0.00s)
    --- PASS: TestMatchVersions/expect_false#02 (0.00s)
    --- PASS: TestMatchVersions/expect_false#03 (0.00s)
    --- PASS: TestMatchVersions/expect_false#04 (0.00s)
    --- PASS: TestMatchVersions/expect_false#05 (0.00s)
    --- PASS: TestMatchVersions/expect_false#06 (0.00s)
    --- PASS: TestMatchVersions/expect_prerelease_suffixed_in_minor_version_to_work (0.00s)
    --- PASS: TestMatchVersions/expect_prerelease_suffixed_in_patch_version_to_work (0.00s)
    --- PASS: TestMatchVersions/expect_prerelease_suffixed_in_patch_version_to_work_in_failing_case (0.00s)
    --- PASS: TestMatchVersions/expect_double_equal_to_work (0.00s)
=== RUN   TestFormatPatchVersio
=== RUN   TestFormatPatchVersio/patch_with_no_dots_should_return_version_should_be_unchanged
=== RUN   TestFormatPatchVersio/patch_with_dots_after_non-integer_patch_version_should_be_unchanged
=== RUN   TestFormatPatchVersio/patch_with_dots_after_integer_patch_version_should_append_dash_and_join_rest_versions_parts
=== RUN   TestFormatPatchVersio/patch_with_dots_after_integer_patch_version_should_append_dash_and_join_extra_versions_parts
=== RUN   TestFormatPatchVersio/unchanged_case
=== RUN   TestFormatPatchVersio/prerelease_suffixed_in_minor
=== RUN   TestFormatPatchVersio/prerelease_suffixed_in_patch
--- PASS: TestFormatPatchVersio (0.00s)
    --- PASS: TestFormatPatchVersio/patch_with_no_dots_should_return_version_should_be_unchanged (0.00s)
    --- PASS: TestFormatPatchVersio/patch_with_dots_after_non-integer_patch_version_should_be_unchanged (0.00s)
    --- PASS: TestFormatPatchVersio/patch_with_dots_after_integer_patch_version_should_append_dash_and_join_rest_versions_parts (0.00s)
    --- PASS: TestFormatPatchVersio/patch_with_dots_after_integer_patch_version_should_append_dash_and_join_extra_versions_parts (0.00s)
    --- PASS: TestFormatPatchVersio/unchanged_case (0.00s)
    --- PASS: TestFormatPatchVersio/prerelease_suffixed_in_minor (0.00s)
    --- PASS: TestFormatPatchVersio/prerelease_suffixed_in_patch (0.00s)
PASS
coverage: 77.1% of statements
ok  	github.com/aquasecurity/trivy/pkg/scanner/utils	0.022s	coverage: 77.1% of statements
?   	github.com/aquasecurity/trivy/pkg/types	[no test files]
=== RUN   TestFileWalk
--- PASS: TestFileWalk (0.00s)
=== RUN   TestFilterTargets
=== RUN   TestFilterTargets/normal
=== RUN   TestFilterTargets/other_directory_with_the_same_prefix
--- PASS: TestFilterTargets (0.00s)
    --- PASS: TestFilterTargets/normal (0.00s)
    --- PASS: TestFilterTargets/other_directory_with_the_same_prefix (0.00s)
=== RUN   TestCopyFile
=== RUN   TestCopyFile/happy_path
--- PASS: TestCopyFile (0.00s)
    --- PASS: TestCopyFile/happy_path (0.00s)
PASS
coverage: 54.3% of statements
ok  	github.com/aquasecurity/trivy/pkg/utils	0.007s	coverage: 54.3% of statements
=== RUN   TestClient_FillInfo
=== RUN   TestClient_FillInfo/happy_path,_with_only_OS_vulnerability_but_no_vendor_severity,_no_NVD
    TestClient_FillInfo/happy_path,_with_only_OS_vulnerability_but_no_vendor_severity,_no_NVD: vulnerability_test.go:381: PASS:	GetVulnerability(string)
=== RUN   TestClient_FillInfo/happy_path,_with_only_OS_vulnerability_but_no_vendor_severity,_yes_NVD
    TestClient_FillInfo/happy_path,_with_only_OS_vulnerability_but_no_vendor_severity,_yes_NVD: vulnerability_test.go:381: PASS:	GetVulnerability(string)
=== RUN   TestClient_FillInfo/happy_path,_with_only_OS_vulnerability_but_no_severity,_no_vendor_severity,_no_NVD
    TestClient_FillInfo/happy_path,_with_only_OS_vulnerability_but_no_severity,_no_vendor_severity,_no_NVD: vulnerability_test.go:381: PASS:	GetVulnerability(string)
=== RUN   TestClient_FillInfo/happy_path,_with_only_OS_vulnerability,_yes_vendor_severity,_with_both_NVD_and_CVSS_info
    TestClient_FillInfo/happy_path,_with_only_OS_vulnerability,_yes_vendor_severity,_with_both_NVD_and_CVSS_info: vulnerability_test.go:381: PASS:	GetVulnerability(string)
=== RUN   TestClient_FillInfo/happy_path,_with_only_OS_vulnerability,_yes_vendor_severity,_with_both_NVD_and_deprecated_vendor_vectors
    TestClient_FillInfo/happy_path,_with_only_OS_vulnerability,_yes_vendor_severity,_with_both_NVD_and_deprecated_vendor_vectors: vulnerability_test.go:381: PASS:	GetVulnerability(string)
=== RUN   TestClient_FillInfo/happy_path_light_db,_with_only_OS_vulnerability,_yes_vendor_severity
    TestClient_FillInfo/happy_path_light_db,_with_only_OS_vulnerability,_yes_vendor_severity: vulnerability_test.go:381: PASS:	GetVulnerability(string)
=== RUN   TestClient_FillInfo/happy_path,_with_only_library_vulnerability
    TestClient_FillInfo/happy_path,_with_only_library_vulnerability: vulnerability_test.go:381: PASS:	GetVulnerability(string)
=== RUN   TestClient_FillInfo/GetVulnerability_returns_an_error
    TestClient_FillInfo/GetVulnerability_returns_an_error: vulnerability_test.go:381: PASS:	GetVulnerability(string)
--- PASS: TestClient_FillInfo (0.00s)
    --- PASS: TestClient_FillInfo/happy_path,_with_only_OS_vulnerability_but_no_vendor_severity,_no_NVD (0.00s)
    --- PASS: TestClient_FillInfo/happy_path,_with_only_OS_vulnerability_but_no_vendor_severity,_yes_NVD (0.00s)
    --- PASS: TestClient_FillInfo/happy_path,_with_only_OS_vulnerability_but_no_severity,_no_vendor_severity,_no_NVD (0.00s)
    --- PASS: TestClient_FillInfo/happy_path,_with_only_OS_vulnerability,_yes_vendor_severity,_with_both_NVD_and_CVSS_info (0.00s)
    --- PASS: TestClient_FillInfo/happy_path,_with_only_OS_vulnerability,_yes_vendor_severity,_with_both_NVD_and_deprecated_vendor_vectors (0.00s)
    --- PASS: TestClient_FillInfo/happy_path_light_db,_with_only_OS_vulnerability,_yes_vendor_severity (0.00s)
    --- PASS: TestClient_FillInfo/happy_path,_with_only_library_vulnerability (0.00s)
    --- PASS: TestClient_FillInfo/GetVulnerability_returns_an_error (0.00s)
=== RUN   TestClient_Filter
=== RUN   TestClient_Filter/happy_path
=== RUN   TestClient_Filter/happy_path_with_ignore-unfixed
=== RUN   TestClient_Filter/happy_path_with_ignore-file
=== RUN   TestClient_Filter/happy_path_with_a_policy_file
--- PASS: TestClient_Filter (0.00s)
    --- PASS: TestClient_Filter/happy_path (0.00s)
    --- PASS: TestClient_Filter/happy_path_with_ignore-unfixed (0.00s)
    --- PASS: TestClient_Filter/happy_path_with_ignore-file (0.00s)
    --- PASS: TestClient_Filter/happy_path_with_a_policy_file (0.00s)
PASS
coverage: 56.7% of statements
ok  	github.com/aquasecurity/trivy/pkg/vulnerability	0.010s	coverage: 56.7% of statements
?   	github.com/aquasecurity/trivy/rpc/cache	[no test files]
?   	github.com/aquasecurity/trivy/rpc/common	[no test files]
?   	github.com/aquasecurity/trivy/rpc/detector	[no test files]
?   	github.com/aquasecurity/trivy/rpc/scanner	[no test files]

@simar7
Copy link
Member

simar7 commented Oct 27, 2020

thanks for all that output @carlosedp, much appreciate it!

@simar7 simar7 merged commit 0285a89 into aquasecurity:master Oct 27, 2020
liamg pushed a commit that referenced this pull request Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants