@{intent3} 10.0.0.1,10.0.0.4 10.0.0.2 ALLOW
@{all_intents} ${intent1} ${intent2} ${intent3}
@{all_intents_ids}
-${intent_validation1} from [10.0.0.1, 10.0.0.4] to [10.0.0.2] apply ALLOW
-${intent_validation2} from [10.0.0.5] to [10.0.0.2] apply BLOCK
-${intent_validation3} from [10.0.0.5] to [10.0.0.3] apply ALLOW
-${intent_validation4} from [10.0.0.5] to [10.0.0.10] apply BLOCK
+${intent_validation1} from [10.0.0.1, 10.0.0.4] to [10.0.0.2]
+${intent_validation2} from [10.0.0.5] to [10.0.0.2]
+${intent_validation3} from [10.0.0.5] to [10.0.0.3]
+${intent_validation4} from [10.0.0.5] to [10.0.0.10]
+${intent_validation_policy1} ALLOW
+${intent_validation_policy2} BLOCK
+${intent_validation_policy3} ALLOW
+${intent_validation_policy4} BLOCK
@{all_intent_validations} ${intent_validation1} ${intent_validation2} ${intent_validation3} ${intent_validation4}
+@{all_intent_validations_policies} ${intent_validation_policy1} ${intent_validation_policy2} ${intent_validation_policy3} ${intent_validation_policy4}
*** Test Cases ***
Verify NIC Command Add and Remove
[Documentation] Verification of NIC Console command add and remove. It first creates the intents
... and stores the intent ids, then verifies that the intents were added. Finally, it compiles the intents
... to verify that intents were properly merged and also validates intents were removed at the end per the cleanup procedure.
+ ... The command "Wait Until Keyword Succeeds" is used to poll for 10 minutes
+ ... until the intent:add command is availible for the test case to be run.
[Tags] NIC
+ Wait Until Keyword Succeeds 10 min 5 sec Verify Intent:Add Command is Availible
: FOR ${intent} IN @{all_intents}
\ ${id}= Add Intent @{intent}
\ Append To List ${all_intents_ids} ${id}
\ ${intent_id}= Get From List ${all_intents_ids} ${index}
\ Verify Intent Added ${intent_id} ${intent}
${output}= Issue Command On Karaf Console intent:compile
- : FOR ${valid_intent} IN @{all_intent_validations}
- \ Should Contain ${output} ${valid_intent}
+ ${size}= Get Length ${all_intent_validations}
+ : FOR ${index} IN RANGE ${size}
+ \ ${compiled_intent_validation}= Get From List ${all_intent_validations} ${index}
+ \ ${intent_validation_line}= Get Lines Containing String ${output} ${compiled_intent_validation}
+ \ ${policy}= Get From List ${all_intent_validations_policies} ${index}
+ \ Should Contain ${intent_validation_line} ${policy}
: FOR ${intent_id} IN @{all_intents_ids}
\ Remove Intent ${intent_id}
${output}= Issue Command On Karaf Console intent:list -c
*** Keywords ***
Setup NIC Console Environment
[Documentation] Installing NIC Console related features (odl-nic-core, odl-nic-console)
+ Install a Feature odl-nic-core-service-mdsal
Install a Feature odl-nic-core
Install a Feature odl-nic-console
Start Suite
${id}= Get From List ${output_split} 3
[Return] ${id}
+Verify Intent:Add Command is Availible
+ [Documentation] Verifies that odl-nic-console is up and intent:add command is available to be used.
+ ... Should be used with the command "Wait Until Keyword Succeeds" to poll until command is availible.
+ ${output}= Issue Command On Karaf Console intent:add
+ Should Not Contain ${output} Command not found
+
+
Verify Intent Added
[Arguments] ${id} ${intent}
[Documentation] This will check if the id exists via intent:list -c, then compares intent details with arguments passed in with Add Intent