Skip to content

Commit

Permalink
flags: change "claimloc" for "output-dir" (#1726)
Browse files Browse the repository at this point in the history
The directory not only contains the claim file but also the log file,
the compressed file with the results and some other helper files.
  • Loading branch information
jmontesi authored Dec 15, 2023
1 parent 7e79d17 commit 4a16fe5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func main() {
os.Exit(1)
}

logFile, err := createLogFile(*flags.ClaimPath)
logFile, err := createLogFile(*flags.OutputDir)
if err != nil {
fmt.Fprintf(os.Stderr, "Could not create the log file, err: %v", err)
os.Exit(1)
Expand All @@ -90,7 +90,7 @@ func main() {
fmt.Printf("CNFCERT version: %s\n", versions.GitVersion())
fmt.Printf("Claim file version: %s\n", versions.ClaimFormatVersion)
fmt.Printf("Checks filter: %s\n", *flags.LabelsFlag)
fmt.Printf("Output folder: %s\n", *flags.ClaimPath)
fmt.Printf("Output folder: %s\n", *flags.OutputDir)
fmt.Printf("Log file: %s\n", log.LogFileName)
fmt.Printf("\n")

Expand All @@ -102,13 +102,13 @@ func main() {
}

// Set clientsholder singleton with the filenames from the env vars.
log.Info("Output folder for the claim file: %s", *flags.ClaimPath)
log.Info("Output folder for the claim file: %s", *flags.OutputDir)
if *flags.ServerModeFlag {
log.Info("Running CNF Certification Suite in web server mode.")
webserver.StartServer(*flags.ClaimPath)
webserver.StartServer(*flags.OutputDir)
} else {
log.Info("Running CNF Certification Suite in stand-alone mode.")
err = certsuite.Run(*flags.LabelsFlag, *flags.ClaimPath)
err = certsuite.Run(*flags.LabelsFlag, *flags.OutputDir)
if err != nil {
log.Error("Failed to run CNF Certification Suite: %v", err)
os.Exit(1)
Expand Down
10 changes: 5 additions & 5 deletions pkg/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
)

const (
claimPathFlagKey = "claimloc"
defaultClaimPath = "."
outputDirFlagKey = "output-dir"
defaultOutputDir = "."
NoLabelsExpr = "none"
labelsFlagName = "label-filter"
labelsFlagDefaultValue = "none"
Expand All @@ -47,7 +47,7 @@ const (
)

var (
ClaimPath *string
OutputDir *string
// labelsFlag holds the labels expression to filter the checks to run.
LabelsFlag *string
TimeoutFlag *string
Expand All @@ -56,8 +56,8 @@ var (
)

func InitFlags() {
ClaimPath = flag.String(claimPathFlagKey, defaultClaimPath,
"the path where the claimfile will be output")
OutputDir = flag.String(outputDirFlagKey, defaultOutputDir,
"the directory where the output artifacts will be placed")
LabelsFlag = flag.String(labelsFlagName, labelsFlagDefaultValue, labelsFlagUsage)
TimeoutFlag = flag.String(timeoutFlagName, TimeoutFlagDefaultvalue.String(), timeoutFlagUsage)
ListFlag = flag.Bool(listFlagName, listFlagDefaultValue, listFlagUsage)
Expand Down
2 changes: 1 addition & 1 deletion run-cnf-suites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fi
# Specify Junit report file name.
EXTRA_ARGS="\
--timeout=$TIMEOUT \
-claimloc $OUTPUT_LOC \
--output-dir $OUTPUT_LOC \
"

if [ "$SERVER_RUN" = "true" ]; then
Expand Down

0 comments on commit 4a16fe5

Please sign in to comment.