-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
338 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
104 changes: 104 additions & 0 deletions
104
test/autests/gold_tests/arguments/repeat_argument/repeat_argument.test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
''' | ||
Verify the user can repeat transactions with --repeat. | ||
''' | ||
# @file | ||
# | ||
# Copyright 2020, Verizon Media | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
|
||
Test.Summary = ''' | ||
Verify the user can repeat transactions with --repeat. | ||
''' | ||
|
||
# | ||
# Test 1: Verify that without the repeat argument the transactions are | ||
# executed once. | ||
# | ||
r = Test.AddTestRun("Verify transactions are executed once with no --repeat argument.") | ||
client = r.AddClientProcess("client1", "replay_files/two_files", | ||
http_ports=[8086], | ||
other_args="--verbose diag") | ||
server = r.AddServerProcess("server1", "replay_files/two_files", | ||
http_ports=[8087], other_args="--verbose diag") | ||
proxy = r.AddProxyProcess("proxy1", listen_port=8086, server_port=8087) | ||
|
||
client.Streams.stdout += Testers.ContainsExpression( | ||
'Parsed 8 transactions', | ||
'Verify the 8 transactions were parsed.') | ||
client.Streams.stdout += Testers.ContainsExpression( | ||
'8 transactions in 5 sessions', | ||
'Verify each transaction is executed once.') | ||
|
||
# | ||
# Test 2: Verify that with --repeat 1 the transactions are executed once. | ||
# | ||
r = Test.AddTestRun("Verify transactions are executed once with --repeat 1.") | ||
client = r.AddClientProcess("client2", "replay_files/two_files", | ||
http_ports=[8086], | ||
other_args="--verbose diag --repeat 1") | ||
server = r.AddServerProcess("server2", "replay_files/two_files", | ||
http_ports=[8087], other_args="--verbose diag") | ||
proxy = r.AddProxyProcess("proxy2", listen_port=8086, server_port=8087) | ||
|
||
client.Streams.stdout += Testers.ContainsExpression( | ||
'Parsed 8 transactions', | ||
'Verify the 8 transactions were parsed.') | ||
client.Streams.stdout += Testers.ContainsExpression( | ||
'8 transactions in 5 sessions', | ||
'Verify each transaction is executed once.') | ||
|
||
# | ||
# Test 3: Verify that with --repeat 0 the transactions are not executed. | ||
# | ||
r = Test.AddTestRun("Verify no transactions are executed with --repeat 0.") | ||
client = r.AddClientProcess("client3", "replay_files/two_files", | ||
http_ports=[8086], | ||
other_args="--verbose diag --repeat 0") | ||
server = r.AddServerProcess("server3", "replay_files/two_files", | ||
http_ports=[8087], other_args="--verbose diag") | ||
proxy = r.AddProxyProcess("proxy3", listen_port=8086, server_port=8087) | ||
|
||
client.Streams.stdout += Testers.ContainsExpression( | ||
'Parsed 8 transactions', | ||
'Verify the 8 transactions were parsed.') | ||
client.Streams.stdout += Testers.ContainsExpression( | ||
'0 transactions in 0 sessions', | ||
'Verify no transactions are executed.') | ||
|
||
# | ||
# Test 4: Verify that with --repeat 2 the transactions are executed twice. | ||
# | ||
r = Test.AddTestRun("Verify transactions are executed twice with --repeat 2.") | ||
client = r.AddClientProcess("client4", "replay_files/two_files", | ||
http_ports=[8086], | ||
other_args="--verbose diag --repeat 2") | ||
server = r.AddServerProcess("server4", "replay_files/two_files", | ||
http_ports=[8087], other_args="--verbose diag") | ||
proxy = r.AddProxyProcess("proxy4", listen_port=8086, server_port=8087) | ||
|
||
client.Streams.stdout += Testers.ContainsExpression( | ||
'Parsed 8 transactions', | ||
'Verify the 8 transactions were parsed.') | ||
client.Streams.stdout += Testers.ContainsExpression( | ||
'16 transactions in 10 sessions', | ||
'Verify each transaction is executed twice.') | ||
|
||
# | ||
# Test 5: Verify that with --repeat 10 the transactions are executed ten times | ||
# | ||
r = Test.AddTestRun("Verify transactions are executed ten times with --repeat 10.") | ||
client = r.AddClientProcess("client5", "replay_files/two_files", | ||
http_ports=[8086], | ||
other_args="--verbose diag --repeat 10") | ||
server = r.AddServerProcess("server5", "replay_files/two_files", | ||
http_ports=[8087], other_args="--verbose diag") | ||
proxy = r.AddProxyProcess("proxy5", listen_port=8086, server_port=8087) | ||
|
||
client.Streams.stdout += Testers.ContainsExpression( | ||
'Parsed 8 transactions', | ||
'Verify the 8 transactions were parsed.') | ||
client.Streams.stdout += Testers.ContainsExpression( | ||
'80 transactions in 50 sessions', | ||
'Verify each transaction is executed ten times.') |
143 changes: 143 additions & 0 deletions
143
...utests/gold_tests/arguments/repeat_argument/replay_files/two_files/five_transactions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
meta: | ||
version: "1.0" | ||
|
||
sessions: | ||
- protocol: [ { name: tcp }, {name: ip, version: 4} ] | ||
transactions: | ||
- all: | ||
headers: | ||
fields: | ||
- [ uuid, 1 ] | ||
client-request: | ||
version: "1.1" | ||
scheme: "http" | ||
method: "GET" | ||
url: "http://example.one/path/1" | ||
headers: | ||
fields: | ||
- [ Host, example.one ] | ||
|
||
proxy-request: | ||
|
||
server-response: | ||
status: 200 | ||
reason: OK | ||
content: | ||
size: 16 | ||
headers: | ||
fields: | ||
- [ Content-Type, text/html ] | ||
- [ Content-Length, 16 ] | ||
|
||
proxy-response: | ||
|
||
- all: | ||
headers: | ||
fields: | ||
- [ uuid, 2 ] | ||
client-request: | ||
version: "1.1" | ||
scheme: "http" | ||
method: "GET" | ||
url: "http://example.one/path/2" | ||
headers: | ||
fields: | ||
- [ Host, example.one ] | ||
|
||
proxy-request: | ||
|
||
server-response: | ||
status: 200 | ||
reason: OK | ||
content: | ||
size: 16 | ||
headers: | ||
fields: | ||
- [ Content-Type, text/html ] | ||
- [ Content-Length, 16 ] | ||
|
||
proxy-response: | ||
|
||
- all: | ||
headers: | ||
fields: | ||
- [ uuid, 3 ] | ||
client-request: | ||
version: "1.1" | ||
scheme: "http" | ||
method: "GET" | ||
url: "http://example.one/path/3" | ||
headers: | ||
fields: | ||
- [ Host, example.one ] | ||
|
||
proxy-request: | ||
|
||
server-response: | ||
status: 200 | ||
reason: OK | ||
content: | ||
size: 16 | ||
headers: | ||
fields: | ||
- [ Content-Type, text/html ] | ||
- [ Content-Length, 16 ] | ||
|
||
proxy-response: | ||
|
||
- all: | ||
headers: | ||
fields: | ||
- [ uuid, 4 ] | ||
client-request: | ||
version: "1.1" | ||
scheme: "http" | ||
method: "GET" | ||
url: "http://example.one/path/4" | ||
headers: | ||
fields: | ||
- [ Host, example.one ] | ||
|
||
proxy-request: | ||
|
||
server-response: | ||
status: 200 | ||
reason: OK | ||
content: | ||
size: 16 | ||
headers: | ||
fields: | ||
- [ Content-Type, text/html ] | ||
- [ Content-Length, 16 ] | ||
|
||
proxy-response: | ||
|
||
- protocol: [ { name: tcp }, {name: ip, version: 4} ] | ||
transactions: | ||
- all: | ||
headers: | ||
fields: | ||
- [ uuid, 5 ] | ||
client-request: | ||
version: "1.1" | ||
scheme: "http" | ||
method: "GET" | ||
url: "http://example.two/path/5" | ||
headers: | ||
fields: | ||
- [ Host, example.one ] | ||
|
||
proxy-request: | ||
|
||
server-response: | ||
status: 200 | ||
reason: OK | ||
content: | ||
size: 16 | ||
headers: | ||
fields: | ||
- [ Content-Type, text/html ] | ||
- [ Content-Length, 16 ] | ||
|
||
proxy-response: | ||
|
91 changes: 91 additions & 0 deletions
91
...tests/gold_tests/arguments/repeat_argument/replay_files/two_files/three_transactions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
meta: | ||
version: "1.0" | ||
|
||
sessions: | ||
- protocol: [ { name: tcp }, {name: ip, version: 4} ] | ||
transactions: | ||
- all: | ||
headers: | ||
fields: | ||
- [ uuid, 11 ] | ||
client-request: | ||
version: "1.1" | ||
scheme: "http" | ||
method: "GET" | ||
url: "http://example.one/path/11" | ||
headers: | ||
fields: | ||
- [ Host, example.one ] | ||
|
||
proxy-request: | ||
|
||
server-response: | ||
status: 200 | ||
reason: OK | ||
content: | ||
size: 16 | ||
headers: | ||
fields: | ||
- [ Content-Type, text/html ] | ||
- [ Content-Length, 16 ] | ||
|
||
proxy-response: | ||
|
||
|
||
- protocol: [ { name: tcp }, {name: ip, version: 4} ] | ||
transactions: | ||
- all: | ||
headers: | ||
fields: | ||
- [ uuid, 12 ] | ||
client-request: | ||
version: "1.1" | ||
scheme: "http" | ||
method: "GET" | ||
url: "http://example.two/path/12" | ||
headers: | ||
fields: | ||
- [ Host, example.one ] | ||
|
||
proxy-request: | ||
|
||
server-response: | ||
status: 200 | ||
reason: OK | ||
content: | ||
size: 16 | ||
headers: | ||
fields: | ||
- [ Content-Type, text/html ] | ||
- [ Content-Length, 16 ] | ||
|
||
proxy-response: | ||
|
||
- protocol: [ { name: tcp }, {name: ip, version: 4} ] | ||
transactions: | ||
- all: | ||
headers: | ||
fields: | ||
- [ uuid, 13 ] | ||
client-request: | ||
version: "1.1" | ||
scheme: "http" | ||
method: "GET" | ||
url: "http://example.two/path/13" | ||
headers: | ||
fields: | ||
- [ Host, example.one ] | ||
|
||
proxy-request: | ||
|
||
server-response: | ||
status: 200 | ||
reason: OK | ||
content: | ||
size: 16 | ||
headers: | ||
fields: | ||
- [ Content-Type, text/html ] | ||
- [ Content-Length, 16 ] | ||
|
||
proxy-response: |