Skip to content

Commit

Permalink
test: add quick test for input > comms search depth
Browse files Browse the repository at this point in the history
  • Loading branch information
carlmontanari committed Sep 10, 2023
1 parent cfdfb03 commit e5577ec
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
28 changes: 28 additions & 0 deletions channel/sendinput_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func testSendInput(testName string, testCase *sendInputTestcase) func(t *testing
}
}

//nolint:lll
func TestSendInput(t *testing.T) {
cases := map[string]*sendInputTestcase{
"send-input-simple": {
Expand All @@ -96,6 +97,33 @@ func TestSendInput(t *testing.T) {
noStripPrompt: false,
eager: false,
},
"send-input-input-size-greater-than-search-depth": {
description: "send input where the input is larger than the comms search depth",
input: `set / system banner login-banner "................................................................
: Welcome to Nokia SR Linux! :
: Open Network OS for the NetOps era. :
: :
: This is a freely distributed official container image. :
: Use it - Share it :
: :
: :
: MOAR INPUT LINES! :
: :
: :
: :
: Get started: https://learn.srlinux.dev :
: Container: https://go.srlinux.dev/container-image :
: Docs: https://doc.srlinux.dev/22-11 :
: Rel. notes: https://doc.srlinux.dev/rn22-11-1 :
: YANG: https://yang.srlinux.dev/v22.11.1 :
: Discord: https://go.srlinux.dev/discord :
: Contact: https://go.srlinux.dev/contact-sales :
................................................................
"`,
payloadFile: "send-input-giant.txt",
noStripPrompt: false,
eager: false,
},
}

for testName, testCase := range cases {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
set / system banner login-banner "................................................................
: Welcome to Nokia SR Linux! :
: Open Network OS for the NetOps era. :
: :
: This is a freely distributed official container image. :
: Use it - Share it :
: :
: :
: MOAR INPUT LINES! :
: :
: :
: :
: Get started: https://learn.srlinux.dev :
: Container: https://go.srlinux.dev/container-image :
: Docs: https://doc.srlinux.dev/22-11 :
: Rel. notes: https://doc.srlinux.dev/rn22-11-1 :
: YANG: https://yang.srlinux.dev/v22.11.1 :
: Discord: https://go.srlinux.dev/discord :
: Contact: https://go.srlinux.dev/contact-sales :
................................................................
"

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--{ * candidate shared default }--[ ]--
24 changes: 24 additions & 0 deletions channel/test-fixtures/send-input-giant.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--{ candidate shared default }--[ ]--
A:srl# set / system banner login-banner "................................................................
: Welcome to Nokia SR Linux! :
: Open Network OS for the NetOps era. :
: :
: This is a freely distributed official container image. :
: Use it - Share it :
: :
: :
: MOAR INPUT LINES! :
: :
: :
: :
: Get started: https://learn.srlinux.dev :
: Container: https://go.srlinux.dev/container-image :
: Docs: https://doc.srlinux.dev/22-11 :
: Rel. notes: https://doc.srlinux.dev/rn22-11-1 :
: YANG: https://yang.srlinux.dev/v22.11.1 :
: Discord: https://go.srlinux.dev/discord :
: Contact: https://go.srlinux.dev/contact-sales :
................................................................
"
--{ * candidate shared default }--[ ]--
A:srl#

0 comments on commit e5577ec

Please sign in to comment.