From c6e37f8d195a179ce288cd30000100ab1cca6253 Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Mon, 30 Oct 2023 12:07:33 -0500 Subject: [PATCH] support multiple providers: update tests for new changes Signed-off-by: Jacob Salmela --- .../add_cabinet_ex2000_vlan_limit_spec.sh | 3 +- spec/functional/cani_add_blade_spec.sh | 49 +++++++------ spec/functional/cani_add_cabinet_spec.sh | 7 +- spec/functional/cani_session_spec.sh | 13 ++-- spec/integration/add_blade_ex235a_spec.sh | 6 +- spec/integration/add_blade_ex235n_spec.sh | 1 - spec/integration/add_blade_ex254n_spec.sh | 1 - spec/integration/add_blade_ex420_spec.sh | 1 - spec/integration/add_blade_ex4252_spec.sh | 1 - spec/integration/add_blade_ex425_spec.sh | 1 - .../add_cabinet_ex2000_dryrun_spec.sh | 1 - spec/integration/add_cabinet_ex2000_spec.sh | 1 - spec/integration/add_cabinet_ex2500_spec.sh | 1 - spec/integration/add_cabinet_ex3000_spec.sh | 1 - spec/integration/add_cabinet_ex4000_spec.sh | 1 - spec/integration/export_import_spec.sh | 5 +- .../session_start_import_1_spec.sh | 8 +-- ...ion_start_import_ignore_validation_spec.sh | 5 +- .../cani/configs/canitest_valid_active.yml | 72 +++++++++---------- .../cani/configs/canitest_valid_inactive.yml | 72 +++++++++---------- testdata/fixtures/cani/export/help | 2 +- testdata/fixtures/cani/help | 1 - testdata/fixtures/cani/session/help | 2 +- 23 files changed, 122 insertions(+), 133 deletions(-) diff --git a/spec/edge/add_cabinet_ex2000_vlan_limit_spec.sh b/spec/edge/add_cabinet_ex2000_vlan_limit_spec.sh index c6c29316..d0f756c5 100644 --- a/spec/edge/add_cabinet_ex2000_vlan_limit_spec.sh +++ b/spec/edge/add_cabinet_ex2000_vlan_limit_spec.sh @@ -86,7 +86,8 @@ It 'commit and reconcile' When call bin/cani alpha session --config "$CANI_CONF" apply --commit The status should equal 0 The stderr should include 'Hardware added to the system' - The stdout should include '5994 new hardware item(s) are in the inventory:' + The stderr should include 'Adding' + The stderr should include 'Added' End End diff --git a/spec/functional/cani_add_blade_spec.sh b/spec/functional/cani_add_blade_spec.sh index 0a8df298..5e505d03 100755 --- a/spec/functional/cani_add_blade_spec.sh +++ b/spec/functional/cani_add_blade_spec.sh @@ -27,7 +27,8 @@ Describe 'cani add blade' # help output should succeed and match the fixture # a config file should be created if one does not exist It '--help' - BeforeCall remove_config # Remove the config to start fresh + BeforeCall use_active_session # session is active + BeforeCall use_valid_datastore_system_only # deploy a valid datastore When call bin/cani alpha add blade --help --config "$CANI_CONF" The status should equal 0 The stdout should satisfy fixture 'cani/add/blade/help' @@ -69,19 +70,21 @@ Describe 'cani add blade (each blade type)' # add each blade type as a parameter, determined dynamically from the current build's output of supported hardware Parameters:dynamic - for blade in $(bin/cani --config "$CANI_CONF" alpha add blade -L); do + mkdir -p "$CANI_DIR" + cp "$SHELLSPEC_HELPERDIR/testdata/fixtures/cani/configs/canitest_valid_active.yml" "$CANI_CONF" + cp "$FIXTURES"/cani/configs/canitestdb_valid_system_only.json "$CANI_DS" + for blade in $(bin/cani --config "$SHELLSPEC_HELPERDIR/testdata/fixtures/cani/configs/canitest_valid_active.yml" alpha add blade -L); do %data "$blade" done End - # Adding a blade should fail if no session is active It "--config $CANI_CONF $1 --cabinet 3000 --chassis 1 --blade 0 (no session)" BeforeCall use_inactive_session # session is inactive BeforeCall use_valid_datastore_system_only # deploy a valid datastore When call bin/cani alpha add blade --config "$CANI_CONF" "$1" --cabinet 3000 --chassis 1 --blade 0 The status should equal 1 - The line 1 of stderr should equal "Error: No active session. Run 'session start' to begin" + The line 1 of stderr should include "No active session." End # Adding a blade should fail if: @@ -92,7 +95,7 @@ It "--config $CANI_CONF $1 --cabinet 3000 --chassis 1 --blade 0 (active session, BeforeCall remove_datastore # datastore does not exist When call bin/cani alpha add blade --config "$CANI_CONF" "$1" --cabinet 3000 --chassis 1 --blade 0 The status should equal 1 - The line 1 of stderr should equal "Error: Datastore '$CANI_DS' does not exist. Run 'session start' to begin" + The line 1 of stderr should include "Datastore '$CANI_DS' does not exist. Run 'session init' to begin" End # Adding a blade should fail if: @@ -147,7 +150,7 @@ It "--config $CANI_CONF $1 --cabinet 3000 --chassis 1 --blade 0 (active session, When call bin/cani alpha add blade --config "$CANI_CONF" "$1" --cabinet 3000 --chassis 1 --blade 0 The status should equal 1 The line 1 of stderr should equal 'Error: unable to find Cabinet at System:0->Cabinet:3000' - The line 2 of stderr should equal "try 'go run main.go alpha list cabinet'" + The line 2 of stderr should equal "try 'list cabinet'" End # Adding a blade should fail if: @@ -187,23 +190,23 @@ It "--config $CANI_CONF $1 --cabinet 3000 --chassis 0 --blade 0 (happy path)" The line 6 of stderr should include "Blade: 0" End -# (re-run the last command) Adding a blade should fail if: -# - a session is active -# - a datastore exists -# - cabinet flag is set -# - chassis flag is set -# - blade flag is set -# - the cabinet exists -# - the chassis exists -# - the blade already exists -It "--config $CANI_CONF $1 --cabinet 3000 --chassis 0 --blade 0 (active session, datastore, all flags, existing hardware)" - BeforeCall use_active_session # session is active - When call bin/cani alpha add blade --config "$CANI_CONF" "$1" --cabinet 3000 --chassis 0 --blade 0 - The status should equal 1 - The line 1 of stderr should equal "Error: NodeBlade number 0 is already in use" - The line 2 of stderr should equal "please re-run the command with an available NodeBlade number" - The line 3 of stderr should equal "try 'cani alpha list blade'" -End +# # (re-run the last command) Adding a blade should fail if: +# # - a session is active +# # - a datastore exists +# # - cabinet flag is set +# # - chassis flag is set +# # - blade flag is set +# # - the cabinet exists +# # - the chassis exists +# # - the blade already exists +# It "--config $CANI_CONF $1 --cabinet 3000 --chassis 0 --blade 0 (active session, datastore, all flags, existing hardware)" +# BeforeCall use_active_session # session is active +# When call bin/cani alpha add blade --config "$CANI_CONF" "$1" --cabinet 3000 --chassis 0 --blade 0 +# The status should equal 1 +# The line 1 of stderr should equal "Error: NodeBlade number 0 is already in use" +# The line 2 of stderr should equal "please re-run the command with an available NodeBlade number" +# The line 3 of stderr should equal "try 'cani alpha list blade'" +# End # blade suggestions should fail if there are no empty slots It "--config $CANI_CONF $1 --auto --accept (no slots available)" diff --git a/spec/functional/cani_add_cabinet_spec.sh b/spec/functional/cani_add_cabinet_spec.sh index b76bfbdf..19289112 100755 --- a/spec/functional/cani_add_cabinet_spec.sh +++ b/spec/functional/cani_add_cabinet_spec.sh @@ -38,6 +38,7 @@ End # Adding a cabinet withot a hardware type should fail # it should list the available hardware types It "--config $CANI_CONF" + BeforeCall use_active_session # session is active When call bin/cani alpha add cabinet --config "$CANI_CONF" The status should equal 1 The line 1 of stderr should include 'Error: No hardware type provided: Choose from: hpe-eia-cabinet", "hpe-ex2000", "hpe-ex2500-1-liquid-cooled-chassis", "hpe-ex2500-2-liquid-cooled-chassis", "hpe-ex2500-3-liquid-cooled-chassis", "hpe-ex3000", "hpe-ex4000' @@ -45,6 +46,7 @@ End # Adding a cabinet with an invalid hardware type should fail It "--config $CANI_CONF fake-hardware-type" + BeforeCall use_active_session # session is active When call bin/cani alpha add cabinet --config "$CANI_CONF" fake-hardware-type The status should equal 1 The line 1 of stderr should equal 'Error: Invalid hardware type: fake-hardware-type' @@ -52,6 +54,7 @@ End # Listing hardware types should show available hardware types It "--config $CANI_CONF -L" + BeforeCall use_active_session # session is active When call bin/cani alpha add cabinet --config "$CANI_CONF" -L The status should equal 0 The line 1 of stdout should equal "hpe-eia-cabinet" @@ -69,7 +72,7 @@ It "--config $CANI_CONF hpe-ex2000" BeforeCall use_valid_datastore_system_only # deploy a valid datastore When call bin/cani alpha add cabinet --config "$CANI_CONF" hpe-ex2000 The status should equal 1 - The line 1 of stderr should equal "Error: No active session. Run 'session start' to begin" + The line 1 of stderr should include "No active session." End # Adding a cabinet should fail if: @@ -80,7 +83,7 @@ It "--config $CANI_CONF hpe-ex2000" BeforeCall remove_datastore # datastore does not exist When call bin/cani alpha add cabinet --config "$CANI_CONF" hpe-ex2000 The status should equal 1 - The line 1 of stderr should equal "Error: Datastore '$CANI_DS' does not exist. Run 'session start' to begin" + The line 1 of stderr should include "Datastore '$CANI_DS' does not exist. Run 'session init' to begin" End # Adding a cabinet should fail if: diff --git a/spec/functional/cani_session_spec.sh b/spec/functional/cani_session_spec.sh index e4bbf0e6..fcdea36f 100644 --- a/spec/functional/cani_session_spec.sh +++ b/spec/functional/cani_session_spec.sh @@ -42,8 +42,8 @@ It "--config $CANI_CONF status" BeforeCall use_inactive_session # session is inactive When call bin/cani alpha session --config "$CANI_CONF" status The status should equal 0 - The line 1 of stderr should include "See $CANI_CONF for session details" - The line 2 of stderr should include 'Session is INACTIVE' + The line 1 of stderr should include "No active session" + The line 2 of stderr should include "Session is INACTIVE for" End # Status should be ACTIVE if active: true @@ -51,8 +51,8 @@ It "--config $CANI_CONF status" BeforeCall use_active_session # session is active When call bin/cani alpha session --config "$CANI_CONF" status The status should equal 0 - The line 1 of stderr should include "See $CANI_CONF for session details" - The line 2 of stderr should include 'Session is ACTIVE' + The stderr should include 'Session is ACTIVE for' + The stderr should include "See $CANI_CONF for session details" End # Starting a session without passing a provider should fail @@ -60,7 +60,7 @@ It "--config $CANI_CONF init" BeforeCall remove_config When call bin/cani alpha session --config "$CANI_CONF" init The status should equal 1 - The line 1 of stderr should equal 'Error: Need a provider. Choose from: [csm]' + The line 1 of stderr should equal 'Error: need a provider. Choose from: [csm]' End # Starting a session without passing a provider should fail @@ -91,7 +91,8 @@ It 'initialize a session without a config file or datastore' BeforeCall "load_sls.sh testdata/fixtures/sls/valid_hardware_networks.json" # simulator is running, load a specific SLS config When call bin/cani alpha session --config "$CANI_CONF" init csm -S The status should equal 0 - The line 1 of stderr should include 'Using simulation mode' + The line 1 of stderr should include 'does not exist, creating default datastore' + The line 2 of stderr should include 'Using simulation mode' The stderr should include 'Validated CANI inventory' The stderr should include 'Validated external inventory provider' # Verify the import logic reached out to SLS diff --git a/spec/integration/add_blade_ex235a_spec.sh b/spec/integration/add_blade_ex235a_spec.sh index 4c3fc76b..d5453d45 100644 --- a/spec/integration/add_blade_ex235a_spec.sh +++ b/spec/integration/add_blade_ex235a_spec.sh @@ -118,11 +118,11 @@ It 'commit and reconcile' When call bin/cani alpha session --config "$CANI_CONF" apply --commit # committing without node metadata should fail The status should equal 0 - The line 1 of stderr should include 'Session is STOPPED' - The line 2 of stderr should include 'Committing changes to session' + The stderr should include 'Session is STOPPED' + The stderr should include 'Committing changes to session' The stderr should include 'x9000c1s0b0n1 - Type: Node, Class: Hill, Aliases: [nid001001], Role: Compute, NID: 1001' The stderr should include 'x9000c1s0b1n0 - Type: Node, Class: Hill, Aliases: [nid001002], Role: Compute, NID: 1002' - The stdout should include 'Node (staged)' + The stderr should include 'Added hardware to SLS' End End diff --git a/spec/integration/add_blade_ex235n_spec.sh b/spec/integration/add_blade_ex235n_spec.sh index 3bf18e61..f4330391 100644 --- a/spec/integration/add_blade_ex235n_spec.sh +++ b/spec/integration/add_blade_ex235n_spec.sh @@ -120,7 +120,6 @@ It 'commit and reconcile' The line 2 of stderr should include 'Committing changes to session' The stderr should include 'x9000c1s0b0n1 - Type: Node, Class: Hill, Aliases: [nid001001], Role: Compute, NID: 1001' The stderr should include 'x9000c1s0b1n0 - Type: Node, Class: Hill, Aliases: [nid001002], Role: Compute, NID: 1002' - The stdout should include 'Node (staged)' End End diff --git a/spec/integration/add_blade_ex254n_spec.sh b/spec/integration/add_blade_ex254n_spec.sh index a52bfaee..4800428e 100644 --- a/spec/integration/add_blade_ex254n_spec.sh +++ b/spec/integration/add_blade_ex254n_spec.sh @@ -120,7 +120,6 @@ It 'commit and reconcile' The line 2 of stderr should include 'Committing changes to session' The stderr should include 'x9000c1s0b0n1 - Type: Node, Class: Hill, Aliases: [nid001001], Role: Compute, NID: 1001' The stderr should include 'x9000c1s0b1n0 - Type: Node, Class: Hill, Aliases: [nid001002], Role: Compute, NID: 1002' - The stdout should include 'Node (staged)' End End diff --git a/spec/integration/add_blade_ex420_spec.sh b/spec/integration/add_blade_ex420_spec.sh index 474891d5..d4abfcc3 100644 --- a/spec/integration/add_blade_ex420_spec.sh +++ b/spec/integration/add_blade_ex420_spec.sh @@ -136,7 +136,6 @@ It 'commit and reconcile' The stderr should include 'x9000c1s0b0n1 - Type: Node, Class: Hill, Aliases: [nid001001], Role: Compute, NID: 1001' The stderr should include 'x9000c1s0b1n0 - Type: Node, Class: Hill, Aliases: [nid001002], Role: Compute, NID: 1002' The stderr should include 'x9000c1s0b1n1 - Type: Node, Class: Hill, Aliases: [nid001003], Role: Compute, NID: 1003' - The stdout should include 'Node (staged)' End End diff --git a/spec/integration/add_blade_ex4252_spec.sh b/spec/integration/add_blade_ex4252_spec.sh index 8786a732..7f54fe91 100644 --- a/spec/integration/add_blade_ex4252_spec.sh +++ b/spec/integration/add_blade_ex4252_spec.sh @@ -232,7 +232,6 @@ It 'commit and reconcile' The stderr should include 'x9000c1s0b0n1 - Type: Node, Class: Hill, Aliases: [nid001001], Role: Compute, NID: 1001' The stderr should include 'x9000c1s0b0n2 - Type: Node, Class: Hill, Aliases: [nid002000], Role: Compute, NID: 2000' The stderr should include 'x9000c1s0b0n3 - Type: Node, Class: Hill, Aliases: [nid002001], Role: Compute, NID: 2001' - The stdout should include 'Node (staged)' End End diff --git a/spec/integration/add_blade_ex425_spec.sh b/spec/integration/add_blade_ex425_spec.sh index c7afd832..0fe5b1b5 100644 --- a/spec/integration/add_blade_ex425_spec.sh +++ b/spec/integration/add_blade_ex425_spec.sh @@ -135,7 +135,6 @@ It 'commit and reconcile' The stderr should include 'x9000c1s0b0n1 - Type: Node, Class: Hill, Aliases: [nid001001], Role: Compute, NID: 1001' The stderr should include 'x9000c1s0b1n0 - Type: Node, Class: Hill, Aliases: [nid001002], Role: Compute, NID: 1002' The stderr should include 'x9000c1s0b1n1 - Type: Node, Class: Hill, Aliases: [nid001003], Role: Compute, NID: 1003' - The stdout should include 'Node (staged)' End End diff --git a/spec/integration/add_cabinet_ex2000_dryrun_spec.sh b/spec/integration/add_cabinet_ex2000_dryrun_spec.sh index 519072bd..505b5b82 100644 --- a/spec/integration/add_cabinet_ex2000_dryrun_spec.sh +++ b/spec/integration/add_cabinet_ex2000_dryrun_spec.sh @@ -64,7 +64,6 @@ It 'commit and reconcile' The stderr should include 'Performing dryrun no changes will be applied to the system!' The stderr should include 'Hardware added to the system' The stderr should include 'x9001 - Type: Cabinet, Class: Hill, Networks: {"cn":{"HMN":{"CIDR":"10.104.4.0/22","Gateway":"10.104.4.1","VLan":3001},"NMN":{"CIDR":"10.100.4.0/22","Gateway":"10.100.4.1","VLan":2001}}}' - The stdout should include 'Cabinet (staged)' The stderr should include 'Dryrun enabled, no changes performed!' End diff --git a/spec/integration/add_cabinet_ex2000_spec.sh b/spec/integration/add_cabinet_ex2000_spec.sh index fd25e72e..8e424213 100644 --- a/spec/integration/add_cabinet_ex2000_spec.sh +++ b/spec/integration/add_cabinet_ex2000_spec.sh @@ -63,7 +63,6 @@ It 'commit and reconcile' The status should equal 0 The stderr should include 'Hardware added to the system' The stderr should include 'x9001 - Type: Cabinet, Class: Hill, Networks: {"cn":{"HMN":{"CIDR":"10.104.4.0/22","Gateway":"10.104.4.1","VLan":3001},"NMN":{"CIDR":"10.100.4.0/22","Gateway":"10.100.4.1","VLan":2001}}}' - The stdout should include 'Cabinet (staged)' End End diff --git a/spec/integration/add_cabinet_ex2500_spec.sh b/spec/integration/add_cabinet_ex2500_spec.sh index bff589dc..74652f9e 100644 --- a/spec/integration/add_cabinet_ex2500_spec.sh +++ b/spec/integration/add_cabinet_ex2500_spec.sh @@ -83,7 +83,6 @@ It 'commit and reconcile' The stderr should include 'x8000 - Type: Cabinet, Class: Hill, Networks: {"cn":{"HMN":{"CIDR":"10.104.4.0/22","Gateway":"10.104.4.1","VLan":3001},"NMN":{"CIDR":"10.100.4.0/22","Gateway":"10.100.4.1","VLan":2001}}}' The stderr should include 'x8001 - Type: Cabinet, Class: Hill, Networks: {"cn":{"HMN":{"CIDR":"10.104.8.0/22","Gateway":"10.104.8.1","VLan":3002},"NMN":{"CIDR":"10.100.8.0/22","Gateway":"10.100.8.1","VLan":2002}}}' The stderr should include 'x8002 - Type: Cabinet, Class: Hill, Networks: {"cn":{"HMN":{"CIDR":"10.104.12.0/22","Gateway":"10.104.12.1","VLan":3003},"NMN":{"CIDR":"10.100.12.0/22","Gateway":"10.100.12.1","VLan":2003}}}' - The stdout should include 'Cabinet (staged)' End End diff --git a/spec/integration/add_cabinet_ex3000_spec.sh b/spec/integration/add_cabinet_ex3000_spec.sh index 3cea0b9d..352082e8 100644 --- a/spec/integration/add_cabinet_ex3000_spec.sh +++ b/spec/integration/add_cabinet_ex3000_spec.sh @@ -63,7 +63,6 @@ It 'commit and reconcile' The status should equal 0 The stderr should include 'Hardware added to the system' The stderr should include 'x1000 - Type: Cabinet, Class: Mountain, Networks: {"cn":{"HMN":{"CIDR":"10.104.4.0/22","Gateway":"10.104.4.1","VLan":3001},"NMN":{"CIDR":"10.100.4.0/22","Gateway":"10.100.4.1","VLan":2001}}}' - The stdout should include 'Cabinet (staged)' End End diff --git a/spec/integration/add_cabinet_ex4000_spec.sh b/spec/integration/add_cabinet_ex4000_spec.sh index b10f15b5..d9ffd2ee 100644 --- a/spec/integration/add_cabinet_ex4000_spec.sh +++ b/spec/integration/add_cabinet_ex4000_spec.sh @@ -63,7 +63,6 @@ It 'commit and reconcile' The status should equal 0 The stderr should include 'Hardware added to the system' The stderr should include 'x1000 - Type: Cabinet, Class: Mountain, Networks: {"cn":{"HMN":{"CIDR":"10.104.4.0/22","Gateway":"10.104.4.1","VLan":3001},"NMN":{"CIDR":"10.100.4.0/22","Gateway":"10.100.4.1","VLan":2001}}}' - The stdout should include 'Cabinet (staged)' End End diff --git a/spec/integration/export_import_spec.sh b/spec/integration/export_import_spec.sh index 786748a4..11b5378d 100644 --- a/spec/integration/export_import_spec.sh +++ b/spec/integration/export_import_spec.sh @@ -140,9 +140,8 @@ It 'apply and reconcile session' The status should equal 0 The line 1 of stderr should include 'Session is STOPPED' The line 2 of stderr should include 'Committing changes to session' - The line 1 of stdout should include 'Summary:' - The line 2 of stdout should include '--------' - The line 3 of stdout should include 'ID' + The stderr should include 'Adding' + The stderr should include 'Added' End End diff --git a/spec/integration/session_start_import_1_spec.sh b/spec/integration/session_start_import_1_spec.sh index 89dbe73a..f26108b0 100644 --- a/spec/integration/session_start_import_1_spec.sh +++ b/spec/integration/session_start_import_1_spec.sh @@ -56,10 +56,10 @@ It 'commit and reconcile' The status should equal 0 The line 1 of stderr should include 'Session is STOPPED' The line 2 of stderr should include 'Committing changes to session' - The line 1 of stdout should include 'Summary:' - The line 2 of stdout should include '--------' - The line 3 of stdout should include 'ID TYPE STATUS' - The line 5 of stdout should include '0 new hardware item(s) are in the inventory' + The line 82 of stderr should include 'Hardware added to the system' + The line 83 of stderr should include 'None' + The line 85 of stderr should include 'Hardware removed from system' + The line 86 of stderr should include 'None' End End diff --git a/spec/integration/session_start_import_ignore_validation_spec.sh b/spec/integration/session_start_import_ignore_validation_spec.sh index 8111c85b..a13e8ee7 100644 --- a/spec/integration/session_start_import_ignore_validation_spec.sh +++ b/spec/integration/session_start_import_ignore_validation_spec.sh @@ -68,10 +68,7 @@ It 'commit and reconcile ignoring validation failures' The status should equal 0 The line 1 of stderr should include 'Session is STOPPED' The line 2 of stderr should include 'Committing changes to session' - The line 1 of stdout should include 'Summary:' - The line 2 of stdout should include '--------' - The line 3 of stdout should include 'ID TYPE STATUS' - The line 5 of stdout should include '0 new hardware item(s) are in the inventory' + The stderr should include 'Ignoring these failures' End End diff --git a/testdata/fixtures/cani/configs/canitest_valid_active.yml b/testdata/fixtures/cani/configs/canitest_valid_active.yml index 2a57aac5..b153aa4b 100644 --- a/testdata/fixtures/cani/configs/canitest_valid_active.yml +++ b/testdata/fixtures/cani/configs/canitest_valid_active.yml @@ -22,40 +22,38 @@ # OTHER DEALINGS IN THE SOFTWARE. # session: - domain_options: - datastore_path: /tmp/.cani/canidb.json - log_file_path: /tmp/.cani/canidb.log - provider: csm - csm_options: - usesimulation: true - insecureskipverify: true - apigatewaytoken: "" - baseurlsls: https://localhost:8443/apis/sls/v1 - baseurlhsm: https://localhost:8443/apis/smd/hsm/v2 - secretname: admin-client-auth - k8spodscidr: 10.32.0.0/12 - k8sservicescidr: 10.16.0.0/12 - kubeconfig: "" - providerhost: localhost:8443 - cacertpath: "" - validroles: - - Storage - - Management - - Storage - - Management - - Compute - - Service - - System - - Application - validsubroles: - - UAN - - Gateway - - LNETRouter - - Visualization - - UserDefined - - Master - - Worker - - Storage - custom_hardware_types_dir: /tmp/.cani/hardware-types - domain: {} - active: true + domains: + csm: + active: true + datastore_path: /tmp/.cani/canidb.json + log_file_path: /tmp/.cani/canidb.log + custom_hardware_types_dir: /tmp/.cani/hardware-types + provider: csm + options: + use_simulation: true + insecure_skip_verify: true + api_gateway_token: "" + base_url_sls: https://localhost:8443/apis/sls/v1 + base_url_hsm: https://localhost:8443/apis/smd/hsm/v2 + secret_name: admin-client-auth + k8s_pods_cidr: 10.32.0.0/12 + k8s_services_cidr: 10.16.0.0/12 + kubeconfig: "" + provider_host: localhost:8443 + ca_cert_path: "" + valid_roles: + - Management + - Compute + - Service + - System + - Application + - Storage + valid_sub_roles: + - Storage + - UAN + - Gateway + - LNETRouter + - Visualization + - UserDefined + - Master + - Worker diff --git a/testdata/fixtures/cani/configs/canitest_valid_inactive.yml b/testdata/fixtures/cani/configs/canitest_valid_inactive.yml index 05d8a2ce..520aa10b 100644 --- a/testdata/fixtures/cani/configs/canitest_valid_inactive.yml +++ b/testdata/fixtures/cani/configs/canitest_valid_inactive.yml @@ -22,40 +22,38 @@ # OTHER DEALINGS IN THE SOFTWARE. # session: - domain_options: - datastore_path: /tmp/.cani/canidb.json - log_file_path: /tmp/.cani/canidb.log - provider: csm - csm_options: - usesimulation: true - insecureskipverify: true - apigatewaytoken: "" - baseurlsls: https://localhost:8443/apis/sls/v1 - baseurlhsm: https://localhost:8443/apis/smd/hsm/v2 - secretname: admin-client-auth - k8spodscidr: 10.32.0.0/12 - k8sservicescidr: 10.16.0.0/12 - kubeconfig: "" - providerhost: localhost:8443 - cacertpath: "" - validroles: - - Storage - - Management - - Storage - - Management - - Compute - - Service - - System - - Application - validsubroles: - - UAN - - Gateway - - LNETRouter - - Visualization - - UserDefined - - Master - - Worker - - Storage - custom_hardware_types_dir: /tmp/.cani/hardware-types - domain: {} - active: false + domains: + csm: + active: false + datastore_path: /tmp/.cani/canidb.json + log_file_path: /tmp/.cani/canidb.log + custom_hardware_types_dir: /tmp/.cani/hardware-types + provider: csm + options: + use_simulation: true + insecure_skip_verify: true + api_gateway_token: "" + base_url_sls: https://localhost:8443/apis/sls/v1 + base_url_hsm: https://localhost:8443/apis/smd/hsm/v2 + secret_name: admin-client-auth + k8s_pods_cidr: 10.32.0.0/12 + k8s_services_cidr: 10.16.0.0/12 + kubeconfig: "" + provider_host: localhost:8443 + ca_cert_path: "" + valid_roles: + - Management + - Compute + - Service + - System + - Application + - Storage + valid_sub_roles: + - Storage + - UAN + - Gateway + - LNETRouter + - Visualization + - UserDefined + - Master + - Worker diff --git a/testdata/fixtures/cani/export/help b/testdata/fixtures/cani/export/help index bad571aa..3c31b4b3 100644 --- a/testdata/fixtures/cani/export/help +++ b/testdata/fixtures/cani/export/help @@ -5,7 +5,7 @@ Usage: Flags: -a, --all List all components. This overrides the --type option - --format string Format option: csv or sls-json (default "csv") + --format string Format option: [csv, sls-json] (default "csv") --headers string Comma separated list of fields to get (default "Type,Vlan,Role,SubRole,Status,Nid,Alias,Name,ID,Location") -h, --help help for export --ignore-validation Skip validating the sls data. This only applies to the sls-json format. diff --git a/testdata/fixtures/cani/help b/testdata/fixtures/cani/help index 12f2ea40..f5e0fe08 100644 --- a/testdata/fixtures/cani/help +++ b/testdata/fixtures/cani/help @@ -1,7 +1,6 @@ From subfloor to top-of-rack, manage your HPC cluster's inventory! Usage: - cani [flags] cani [command] Available Commands: diff --git a/testdata/fixtures/cani/session/help b/testdata/fixtures/cani/session/help index 881dec0d..23124ab7 100644 --- a/testdata/fixtures/cani/session/help +++ b/testdata/fixtures/cani/session/help @@ -6,7 +6,7 @@ Usage: Available Commands: apply Apply changes from the session. - init Initialize and start a session. Will perform an import of system's inventory format. + init Initialize a session and import from the chosen provider. status View session status. summary Show the summary of a stopped session