Skip to content

Send Multiple Packets per Connection for testing A5#25

Open
DeekshithPatil wants to merge 6 commits intomasterfrom
a5-send-multiple-packets
Open

Send Multiple Packets per Connection for testing A5#25
DeekshithPatil wants to merge 6 commits intomasterfrom
a5-send-multiple-packets

Conversation

@DeekshithPatil
Copy link
Copy Markdown

No description provided.

# @param1 : The string to send
# @param2 : The previous compare file
# Returns if the test passes, exits with error if the test fails.
function test_send_multiple_packets
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DeekshithPatil I'd like to avoid duplicating logic here. Can we modify the send string function to support sending more than one string if it doesn't support this already? I think you might be able to just specify newlines in the argument. Did you try this?

@@ -0,0 +1,4 @@
first packet
01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
third packet
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DeekshithPatil I'd like to avoid adding another file... either just use newline in the string you send (ideally) or a heredoc in the shell script.


sendstring=`cat multiple_packets.txt`

test_send_multiple_packets "${sendstring}" "${comparefile}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DeekshithPatil probably have a rogue /t tab character here. Try deleting to the beginning of the line and replacing with spaces instead of tabs.

fi

if [ "$multi_line_string_test" = true ]; then
echo "Sending Multiple packets from multiple_packets.txt file"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DeekshithPatil I think this should no longer reference multiple_packets.txt file?

if [ "$multi_line_string_test" = true ]; then
echo "Sending Multiple packets from multiple_packets.txt file"

sendstring=$multi_line_string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DeekshithPatil I think you can drop this line and just pass multi_line_string as the first argument in the next line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants