Skip to content

Commit

Permalink
Question template for user provided L1 (#8142)
Browse files Browse the repository at this point in the history
* Add question template for input L1 edges

* rev long description

* Rename question; tweak description

* fix ref

Co-authored-by: Daniel Halperin <dan@intentionet.com>
  • Loading branch information
ratulm and dhalperi committed Mar 16, 2022
1 parent e0225a0 commit 113682d
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
33 changes: 33 additions & 0 deletions questions/stable/userProvidedLayer1Edges.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"class": "org.batfish.question.edges.EdgesQuestion",
"differential": false,
"instance": {
"description": "Returns normalized Layer 1 edges that were input to Batfish.",
"instanceName": "userProvidedLayer1Edges",
"longDescription": "Lists Layer 1 edges after potentially normalizing node and interface names. All node names are lower-cased, and for nodes that appear in the snapshot, interface names are canonicalized based on the vendor. All input edges are in the output, including nodes and interfaces that do not appear in the snapshot.",
"orderedVariableNames": [
"nodes",
"remoteNodes"
],
"tags": [
"topology"
],
"variables": {
"nodes": {
"description": "Include edges whose first node matches this name or regex",
"type": "nodeSpec",
"value": ".*",
"displayName": "Nodes"
},
"remoteNodes": {
"description": "Include edges whose second node matches this name or regex",
"type": "nodeSpec",
"value": ".*",
"displayName": "Remote Nodes"
}
}
},
"edgeType": "user_provided_layer1",
"nodes": "${nodes}",
"remoteNodes": "${remoteNodes}"
}
3 changes: 3 additions & 0 deletions tests/questions/stable/commands
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ test -raw tests/questions/stable/undefinedReferences.ref validate-template undef
# validate unusedstructures
test -raw tests/questions/stable/unusedStructures.ref validate-template unusedstructures nodes=".*"

# validate userProvidedLayer1Edges
test -raw tests/questions/stable/userProvidedLayer1Edges.ref validate-template userProvidedLayer1Edges nodes=".*", remoteNodes=".*"

# validate viConversionStatus
test -raw tests/questions/stable/viConversionStatus.ref validate-template viConversionStatus

Expand Down
37 changes: 37 additions & 0 deletions tests/questions/stable/userProvidedLayer1Edges.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"class" : "org.batfish.question.edges.EdgesQuestion",
"edgeType" : "USER_PROVIDED_LAYER1",
"initial" : false,
"nodes" : ".*",
"remoteNodes" : ".*",
"differential" : false,
"includeOneTableKeys" : true,
"instance" : {
"description" : "Returns normalized Layer 1 edges that were input to Batfish.",
"instanceName" : "qname",
"longDescription" : "Lists Layer 1 edges after potentially normalizing node and interface names. All node names are lower-cased, and for nodes that appear in the snapshot, interface names are canonicalized based on the vendor. All input edges are in the output, including nodes and interfaces that do not appear in the snapshot.",
"orderedVariableNames" : [
"nodes",
"remoteNodes"
],
"tags" : [
"topology"
],
"variables" : {
"nodes" : {
"description" : "Include edges whose first node matches this name or regex",
"displayName" : "Nodes",
"optional" : false,
"type" : "nodeSpec",
"value" : ".*"
},
"remoteNodes" : {
"description" : "Include edges whose second node matches this name or regex",
"displayName" : "Remote Nodes",
"optional" : false,
"type" : "nodeSpec",
"value" : ".*"
}
}
}
}

0 comments on commit 113682d

Please sign in to comment.