From 2950e14981327cb913efe8c97490a7c0e9e35066 Mon Sep 17 00:00:00 2001 From: Ivan Milchev Date: Thu, 30 May 2024 13:39:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20fix=20cli=20tests=20(#1309)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🧹 fix cli tests Signed-off-by: Ivan Milchev * run tests if ct files change Signed-off-by: Ivan Milchev * fix vuln ct test Signed-off-by: Ivan Milchev --------- Signed-off-by: Ivan Milchev --- .github/workflows/pr-test-lint.yml | 1 + test/cli/testdata/cnspec.ct | 4 +--- test/cli/testdata/cnspec_vuln.ct | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-test-lint.yml b/.github/workflows/pr-test-lint.yml index 84b62f0e..1ac71fc6 100644 --- a/.github/workflows/pr-test-lint.yml +++ b/.github/workflows/pr-test-lint.yml @@ -6,6 +6,7 @@ on: paths: - '**.go' - '**.mod' + - '**.ct' - 'go.sum' - '.github/workflows/pr-test-lint.yml' diff --git a/test/cli/testdata/cnspec.ct b/test/cli/testdata/cnspec.ct index b27f4094..d759237d 100644 --- a/test/cli/testdata/cnspec.ct +++ b/test/cli/testdata/cnspec.ct @@ -25,6 +25,7 @@ Available Commands: status Verify access to Mondoo Platform vault Manage vault environments version Display the cnspec version + vuln Scans a target for vulnerabilities Flags: --api-proxy string Set proxy for communications with Mondoo API @@ -34,7 +35,4 @@ Flags: --log-level string Set log level: error, warn, info, debug, trace (default "info") -v, --verbose Enable verbose output -Additional help topics: - cnspec vuln Scans a target for vulnerabilities - Use "cnspec [command] --help" for more information about a command. diff --git a/test/cli/testdata/cnspec_vuln.ct b/test/cli/testdata/cnspec_vuln.ct index 89160251..d28f20b7 100644 --- a/test/cli/testdata/cnspec_vuln.ct +++ b/test/cli/testdata/cnspec_vuln.ct @@ -1,2 +1,28 @@ $ cnspec vuln --help Scans a target for vulnerabilities + +Usage: + cnspec vuln [command] + +Available Commands: + sbom Check for vulnerabilities read SBOM file on disk + +Flags: + --asset-name string User-override for the asset name + -h, --help help for vuln + --inventory-ansible Set the inventory format to Ansible. + --inventory-domainlist Set the inventory format to domain list. + --inventory-file string Set the path to the inventory file. + -j, --json Run the query and return the object in a JSON structure. + -o, --output string Set output format: compact, csv, full, json, json-v1, json-v2, junit, report, summary, yaml, yaml-v1, yaml-v2 (default "full") + --platform-id string Select a specific target asset by providing its platform ID. + --props stringToString Custom values for properties (default []) + +Global Flags: + --api-proxy string Set proxy for communications with Mondoo API + --auto-update Enable automatic provider installation and update (default true) + --config string Set config file path (default $HOME/.config/mondoo/mondoo.yml) + --log-level string Set log level: error, warn, info, debug, trace (default "info") + -v, --verbose Enable verbose output + +Use "cnspec vuln [command] --help" for more information about a command. \ No newline at end of file