Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit fbefd62

Browse files
committed
tests: count get responses before making a POST request
Otherwise a post may be received before get and returned value will be wrong. Signed-off-by: Bruno Dilly <bruno.dilly@intel.com>
1 parent d12f85b commit fbefd62

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

src/test-fbp/http-boolean.fbp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030

3131
constant-server(constant/boolean:value=true)
32-
constant-client(test/boolean-generator:sequence="F")
32+
response-count(int/accumulator:setup_value=0|2)
33+
constant-client(converter/empty-to-boolean:output_value=false)
3334
string(constant/string:value="true")
3435
json-str(constant/string:value="{\"/test\":true}")
3536

@@ -66,6 +67,10 @@ json-str OUT -> IN[0] json-compare
6667
get-json OBJECT -> IN json-blob OUT -> IN blob-str
6768
blob-str OUT -> IN[1] json-compare
6869

70+
get-blob OUT -> INC response-count
71+
get-string OUT -> INC response-count
72+
get-json OBJECT -> INC response-count
73+
response-count OVERFLOW -> IN constant-client
6974
constant-client OUT -> POST post
7075

7176
server-validator OUT -> RESULT test_server_output(test/result)

src/test-fbp/http-drange.fbp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030

3131
constant-server(constant/float:value=1.5,value_spec=min:0|max:100|step:2.1415)
32-
constant-client(test/float-generator:sequence="5.4")
32+
response-count(int/accumulator:setup_value=0|2)
33+
constant-client(converter/empty-to-float:output_value=5.4)
3334
string(constant/string:value="1.5")
3435
json-str(constant/string:value="{\"/test\":{\"value\":1.5,\"min\":0,\"max\":100,\"step\":2.1415}}")
3536

@@ -66,6 +67,10 @@ json-str OUT -> IN[0] json-compare
6667
get-json OBJECT -> IN json-blob OUT -> IN blob-str
6768
blob-str OUT -> IN[1] json-compare
6869

70+
get-blob OUT -> INC response-count
71+
get-string OUT -> INC response-count
72+
get-json OBJECT -> INC response-count
73+
response-count OVERFLOW -> IN constant-client
6974
constant-client OUT -> POST post
7075

7176
server-validator OUT -> RESULT test_server_output(test/result)

src/test-fbp/http-irange.fbp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030

3131
constant-server(constant/int:value=1,value_spec=min:0|max:100|step:1)
32-
constant-client(test/int-generator:sequence="5")
32+
response-count(int/accumulator:setup_value=0|2)
33+
constant-client(converter/empty-to-int:output_value=5)
3334
string(constant/string:value="1")
3435
json-str(constant/string:value="{\"/test\":{\"value\":1,\"min\":0,\"max\":100,\"step\":1}}")
3536

@@ -66,6 +67,10 @@ json-str OUT -> IN[0] json-compare
6667
get-json OBJECT -> IN json-blob OUT -> IN blob-str
6768
blob-str OUT -> IN[1] json-compare
6869

70+
get-blob OUT -> INC response-count
71+
get-string OUT -> INC response-count
72+
get-json OBJECT -> INC response-count
73+
response-count OVERFLOW -> IN constant-client
6974
constant-client OUT -> POST post
7075

7176
server-validator OUT -> RESULT test_server_output(test/result)

src/test-fbp/http-string.fbp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030

3131
constant-server(constant/string:value="hello")
32-
constant-client(test/string-generator:sequence="world")
32+
response-count(int/accumulator:setup_value=0|2)
33+
constant-client(converter/empty-to-string:output_value="world")
3334
json-str(constant/string:value="{\"/test\":\"hello\"}")
3435

3536
json-blob(converter/json-object-to-blob)
@@ -65,6 +66,10 @@ json-str OUT -> IN[0] json-compare
6566
get-json OBJECT -> IN json-blob OUT -> IN blob-str
6667
blob-str OUT -> IN[1] json-compare
6768

69+
get-blob OUT -> INC response-count
70+
get-string OUT -> INC response-count
71+
get-json OBJECT -> INC response-count
72+
response-count OVERFLOW -> IN constant-client
6873
constant-client OUT -> POST post
6974

7075
server-validator OUT -> RESULT test_server_output(test/result)

0 commit comments

Comments
 (0)