Skip to content

Commit 4c1bceb

Browse files
authored
Merge pull request #12
Added decoding for more comands and other fixes
2 parents 0c09e2f + 8002299 commit 4c1bceb

File tree

2 files changed

+404
-89
lines changed

2 files changed

+404
-89
lines changed

README.md

Lines changed: 66 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,51 @@
11
# PayShieldPPressureTest
22

3-
<a href="https://www.jetbrains.com/?from=PayshieldPPressureTest"><img src=images/jetbrains-variant-3.png width=100></a>May thanks to <a href="https://www.jetbrains.com/?from=PayshieldPPressureTest">JetBrains</a> for giving us the <b>Open Source License</b> for free with the full access to their developer suite.
4-
<a href="https://www.jetbrains.com/pycharm/?from=PayshieldPPressureTesPyCharm">PyCharm</a> is an awesome Python IDE that greatly simplified my work.
3+
<a href="https://www.jetbrains.com/?from=PayshieldPPressureTest"><img src=images/jetbrains-variant-3.png width=100></a>
4+
Many thanks to <a href="https://www.jetbrains.com/?from=PayshieldPPressureTest">JetBrains</a> for giving us the <b>Open
5+
Source License</b> for free with the full access to their developer suite.
6+
<a href="https://www.jetbrains.com/pycharm/?from=PayshieldPPressureTesPyCharm">PyCharm</a> is an awesome Python IDE that
7+
greatly simplified my work.
58

69
&nbsp;
710

8-
The **pressureTest.py** Python script creates a workload on the **Thales payShield 10k** and **9k** appliances.
9-
The script can be useful during demonstrations of the monitoring features of the appliance and can be used in every case you need to generate a workload for testing purposes.
10-
11+
The **pressureTest.py** Python script creates a workload on the **Thales payShield 10k** and **9k** appliances.
12+
The script can be useful during demonstrations of the monitoring features of the appliance and can be used in every case
13+
you need to generate a workload for testing purposes.
14+
1115
The project is in an early development stage and still a bit clumsy.
1216

13-
It requires **Python 3**. It was tested on **Python 3.7** and **3.8** using a **payShield 10k**.
17+
It requires **Python 3**. It was tested on **Python 3.7** and **3.8** using a **payShield 10k** with firmware **1.3a**
18+
19+
## Version
1420

21+
**1.1.3**
1522

1623
## Usage
1724

18-
**pressureTest.py \[-h\] \[--port PORT\] \[--proto {tcp, udp, tls}\] \[--keyfile CLIENT.KEY\] \[--crtfile CLIENT.CRT\] \[--key {2048,4096} | --nc | --j2 | --j4 | --n8 | --jk | --randgen\] \[--head HEADER\] \[--forever\] \[--times TIMES\] host**
25+
pressureTest.py [-h] [--port PORT] [--key {2048,4096} | --nc | --no | --j2 | --j4 | --j8 | --jk | --randgen]
26+
[--header HEADER] [--forever] [--decode] [--times TIMES] [--proto {tcp,udp,tls}] [--keyfile KEYFILE]
27+
[--crtfile CRTFILE]
28+
host
1929

20-
**host** you need to specify the ip address or the hostname/fqdn of the **payShield** appliance.
30+
**host** *ip address* or the *hostname/fqdn* of the **payShield** appliance.
2131

22-
**--port** specify the host port, if the parameter is omitted the default value **1500** is used.
32+
**--port** specifies the host port, if omitted the default value **1500** is used.
2333

24-
**--proto** specify the protocol to use, **tcp**, **udp** or **tls**, if the parameter is omitted the default value **
25-
tcp** is used. If **tls** is used you might specify the path of the client key file and the certificate using the
26-
parameters **--keyfile** and **--crtfile**
34+
**--proto** specify the protocol to use, **tcp**, **udp** or **tls**, if omitted the default value **tcp**
35+
is used.
36+
If **tls** is used you might specify the path of the client key file and the certificate using the parameters **
37+
--keyfile** and **--crtfile**.
2738

28-
**--keyfile** the path of the client key file, if is not specified the default value is **client.key**. It's only
29-
considered if the protocol is **tls**
39+
**--keyfile** the path of the client key file, if is not specified the default value is **client.key**.
40+
It's only considered if the protocol is **tls**.
3041

31-
**--crtfile** the path of the client certificate file, if is not specified the default value is **client.crt**. It's
32-
only considered if the protocol is **tls**
42+
**--crtfile** the path of the client certificate file, if is not specified the default value is **client.crt**.
43+
It's only considered if the protocol is **tls**.
3344

34-
**--key** the length of the RSA key that the appliance will generate. There are only two valid values: **2048** or **
35-
4096**. If the parameter is not specified **2048** is the default.
45+
**--key** the length of the RSA to generate. There are only two valid values: **2048** or **4096**.
46+
If not specified, **2048** is the default.
3647

37-
**--header** the header string to prefix to the host command, if it is not specified the default value is **HEAD**.
48+
**--header** the header string to prefix to the host command, if not specified the default value is **HEAD**.
3849

3950
**--nc** performs just an **NC** test. It cannot be used in conjunction with **--key**.
4051

@@ -54,35 +65,36 @@ only considered if the protocol is **tls**
5465

5566
**--times** how many times execute the test. If it is not specified the default value is **1000** times.
5667

57-
**--decode** decodes the response of the payShield if a decoder function is available for the command.
68+
**--decode** decodes the response of the payShield if a decoder function is available for the command.
69+
The commands **--decode** supports in the release are: **N0**, **NO**, **NC**, **J2**, **J4**, **J8** and **JK**.
5870

5971
## Example
6072

61-
C:\Test>*python pressureTest.py 192.168.0.36 --nc --times 2*
62-
63-
PayShield stress utility, version 1.1.1, by Marco S. Zuppone - msz@msz.eu - https://msz.eu
64-
To get more info about the usage invoke it with the -h option This software is open source, and it is under the Affero
65-
AGPL 3.0 license
66-
67-
Iteration: 1 of 2
68-
69-
Return code: 00 No error
70-
Command sent/received: NC ==> ND
71-
sent data (ASCII) : b'HEADNC'
72-
sent data (HEX) : b'0006484541444e43'
73-
received data (ASCII): b'HEADND005D672700000000001500-0023'
74-
received data (HEX) : b'0021484541444e44303035443637323730303030303030303030313530302d30303233'
75-
76-
Iteration: 2 of 2
77-
78-
Return code: 00 No error
79-
Command sent/received: NC ==> ND
80-
sent data (ASCII) : b'HEADNC'
81-
sent data (HEX) : b'0006484541444e43'
82-
received data (ASCII): b'HEADND005D672700000000001500-0023'
83-
received data (HEX) : b'0021484541444e44303035443637323730303030303030303030313530302d30303233'
84-
85-
DONE
73+
C:\Test>python pressureTest.py 192.168.0.36 --nc --times 2
74+
75+
PayShield stress utility, version 1.1.3, by Marco S. Zuppone - msz@msz.eu - https://msz.eu
76+
To get more info about the usage invoke it with the -h option This software is open source, and it is under the Affero
77+
AGPL 3.0 license
78+
79+
Iteration: 1 of 2
80+
81+
Return code: 00 No error
82+
Command sent/received: NC ==> ND
83+
sent data (ASCII) : b'HEADNC'
84+
sent data (HEX) : b'0006484541444e43'
85+
received data (ASCII): b'HEADND005D672700000000001500-0023'
86+
received data (HEX) : b'0021484541444e44303035443637323730303030303030303030313530302d30303233'
87+
88+
Iteration: 2 of 2
89+
90+
Return code: 00 No error
91+
Command sent/received: NC ==> ND
92+
sent data (ASCII) : b'HEADNC'
93+
sent data (HEX) : b'0006484541444e43'
94+
received data (ASCII): b'HEADND005D672700000000001500-0023'
95+
received data (HEX) : b'0021484541444e44303035443637323730303030303030303030313530302d30303233'
96+
97+
DONE
8698

8799
## NOTES
88100

@@ -95,15 +107,15 @@ The **EI** command used to generate the RSA key requires authorization, and the
95107

96108
Copyright(C) 2020-2021 **Marco S. Zuppone** - **msz@msz.eu** - [https://msz.eu](https://msz.eu)
97109

98-
This program is free software: you can redistribute it and/or modify
99-
it under the terms of the GNU Affero General Public License as
100-
published by the Free Software Foundation, either version 3 of the
101-
License, or any later version.
110+
This program is free software: you can redistribute it and/or modify
111+
it under the terms of the GNU Affero General Public License as
112+
published by the Free Software Foundation, either version 3 of the
113+
License, or any later version.
114+
115+
This program is distributed in the hope that it will be useful,
116+
but **WITHOUT ANY WARRANTY; without even the implied warranty of
117+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.** See the
118+
**GNU Affero General Public License** for more details.
102119

103-
This program is distributed in the hope that it will be useful,
104-
but **WITHOUT ANY WARRANTY; without even the implied warranty of
105-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.** See the
106-
GNU Affero General Public License for more details.
107-
108120
## Questions, bugs & suggestions
109121
For any questions, feedback, suggestions, send money ***(yes...it's a dream I know)*** you can contact the author at **msz@msz.eu**

0 commit comments

Comments
 (0)