Skip to content

Commit

Permalink
better regexp in CLI tests (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndegory committed Oct 28, 2016
1 parent 36d55a3 commit 78a1bf5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/amp/cli/test_samples/service-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ service-list:
cmd: docker service ls
args:
options:
expectation: ((ID)(\s)+(NAME)(\s)+(REPLICAS)(\s)+(IMAGE)(\s)+(COMMAND)((.)|(\s))+(pinger)(.)+(appcelerator/pinger)(\s)+(.)*)
expectation: (?ms)ID[[:space:]]+NAME[[:space:]]+REPLICAS[[:space:]]+IMAGE[[:space:]]+COMMAND.+\n[a-z0-9]{12}[[:space:]]+.+appcelerator/pinger
2 changes: 1 addition & 1 deletion cmd/amp/cli/test_samples/stats-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ stats-cpu:
-
options:
- --cpu
expectation: ((Service name)(\s)+(CPU %%)((.)|(\s))+((.)|(\s)){1,}(.)*)
expectation: (?m)Service name[[:space:]]+CPU %%[[:space:]]*\n-+[[:space:]]*\n[a-z]+[[:space:]]+[0-9\.]+%
2 changes: 1 addition & 1 deletion cmd/amp/cli/test_samples/stats-io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ stats-io:
-
options:
- --io
expectation: ((Service name)(\s)+(Disk IO read/write)((.)|(\s))+((.)|(\s)){1,}(.)*)
expectation: (?m)Service name[[:space:]]+Disk IO[[:space:]]+read/write[[:space:]]*\n-+[[:space:]]*\n[a-z]+[[:space:]]+[0-9]+.* / [0-9]+
2 changes: 1 addition & 1 deletion cmd/amp/cli/test_samples/stats-mem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ stats-mem:
-
options:
- --mem
expectation: ((Service name)(\s)+(Mem usage)(\s)+(Mem %%)((.)|(\s))+((.)|(\s)){1,}(.)*)
expectation: (?m)Service name[[:space:]]+Mem usage[[:space:]]+Mem %%[[:space:]]*\n-+[[:space:]]*\n[a-z]+[[:space:]]+.+[1-9\.]+%
2 changes: 1 addition & 1 deletion cmd/amp/cli/test_samples/stats-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ stats-node:
-
options:
- --node
expectation: ((Node id)(\s)+(CPU %%)(\s)+(Mem usage)(\s)+(Mem %%)(\s)+(Disk IO read/write)(\s)+(Net Rx/Tx)((.)|(\s))+((.)|(\s)){1,}(.)*)
expectation: (?m)Node id[[:space:]]+CPU %%[[:space:]]+Mem usage[[:space:]]+Mem %%[[:space:]]+Disk IO read/write[[:space:]]+Net Rx/Tx[[:space:]]*\n(-|[[:space:]])+\n[a-z0-9]{25}[[:space:]]+

0 comments on commit 78a1bf5

Please sign in to comment.