Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INDY-988] testRequestDynamicValidation sdk integration #557

Merged
merged 56 commits into from
Mar 6, 2018
Merged
Changes from 55 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
b7bf039
Additional checks for sdk_ functions
ArtObr Feb 7, 2018
7964748
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Feb 7, 2018
e353bdc
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Feb 8, 2018
bac783f
Fix for exception handling and new function for "json to object" conv…
ArtObr Feb 8, 2018
9194251
Space and the end
ArtObr Feb 8, 2018
8e76fe3
Most of test integrated with txnPoolNodeSet
ArtObr Feb 8, 2018
5213476
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Feb 9, 2018
94ad1a2
3 test left to do
ArtObr Feb 9, 2018
2c5db03
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Feb 12, 2018
1b897bf
two tests left in INDY-1019. Others integrated
ArtObr Feb 12, 2018
995fd31
Little fixes
ArtObr Feb 12, 2018
b7bf226
Import resolve, TODO added
ArtObr Feb 13, 2018
1fc7959
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Feb 13, 2018
c72f389
New line at the end
ArtObr Feb 13, 2018
4b1e35e
TODO for import added
ArtObr Feb 13, 2018
3a622e9
Unused looper import removed
ArtObr Feb 13, 2018
54a0f92
One more test integrated with sdk
ArtObr Feb 14, 2018
b77853a
Fixtures for prev test
ArtObr Feb 14, 2018
edea820
Unused import removed
ArtObr Feb 14, 2018
e69045d
Start of integration
ArtObr Feb 14, 2018
c7434a6
Merge branch 'indy-sdk-integration/INDY-1019' into indy-sdk-integrati…
ArtObr Feb 14, 2018
4a316a1
Changes for test_different_request integration with sdk
ArtObr Feb 19, 2018
c521a5f
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Feb 20, 2018
c966fbb
helper changes commited
ArtObr Feb 20, 2018
1f33869
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Feb 20, 2018
dec5565
INDY-1172 done with chages at pool_transactions
ArtObr Feb 20, 2018
5e7e340
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Feb 20, 2018
29fe6ff
Merge branch 'indy-sdk-integration/INDY-1172' into indy-sdk-integrati…
ArtObr Feb 20, 2018
98475ad
little fix
ArtObr Feb 20, 2018
4c9077b
Code structure changes
ArtObr Feb 20, 2018
023a98a
Additinal code structure changes
ArtObr Feb 20, 2018
cad576f
Started sdk integration of tests
ArtObr Feb 20, 2018
eb627af
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Feb 22, 2018
b5f52a4
Review fixes
ArtObr Feb 22, 2018
e883b70
LibIndy versions update
ArtObr Feb 22, 2018
f36dce1
Merge branch 'indy-sdk-integration/INDY-1019' into indy-sdk-integrati…
ArtObr Feb 22, 2018
080dc2c
temp
ArtObr Feb 22, 2018
0ec2dc6
ha persist test done
ArtObr Feb 22, 2018
58b6c17
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Feb 22, 2018
072bcbb
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Feb 22, 2018
02b1587
more tests done
ArtObr Feb 26, 2018
ce9f2f7
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Feb 26, 2018
313ce5c
review fixes
ArtObr Feb 27, 2018
26e182c
More tests done, some problems
ArtObr Feb 27, 2018
c2fffbd
more tests done
ArtObr Feb 28, 2018
e9ac26e
temp
ArtObr Feb 28, 2018
2ed932e
more tests
ArtObr Feb 28, 2018
1571734
all tests done, except one. need more of exception handling
ArtObr Mar 5, 2018
2cb174d
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Mar 5, 2018
17f4535
exception handling made. One test strange behaviour left
ArtObr Mar 5, 2018
1a00c81
test integrated
ArtObr Mar 5, 2018
538e70b
import fixes
ArtObr Mar 5, 2018
3eb975c
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Mar 6, 2018
f35397a
little fix
ArtObr Mar 6, 2018
ccbdf02
little fix
ArtObr Mar 6, 2018
f73b9b1
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Mar 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions plenum/test/batching_3pc/test_basic_batching.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import types
import pytest
from plenum.common.exceptions import UnauthorizedClientRequest
from plenum.common.exceptions import UnauthorizedClientRequest, RequestRejectedException
from plenum.test.batching_3pc.helper import checkNodesHaveSameRoots
from plenum.test.helper import sendRandomRequests, checkRejectWithReason, waitForSufficientRepliesForRequests
from plenum.test.helper import sdk_send_random_requests, sdk_get_and_check_replies
from stp_core.loop.eventually import eventually
from plenum.common.exceptions import InvalidClientRequest
from plenum.test.helper import sdk_sign_request_from_dict, sdk_send_random_and_check
from plenum.common.request import Request


def testRequestStaticValidation(tconf, looper,txnPoolNodeSet,
def testRequestStaticValidation(tconf, looper, txnPoolNodeSet,
sdk_wallet_client):
"""
Check that for requests which fail static validation, REQNACK is sent
Expand Down Expand Up @@ -59,7 +59,7 @@ def testTreeRootsCorrectAfterEachBatch(tconf, looper, txnPoolNodeSet,


def testRequestDynamicValidation(tconf, looper, txnPoolNodeSet,
client, wallet1):
sdk_pool_handle, sdk_wallet_client):
"""
Check that for requests which fail dynamic (state based) validation,
REJECT is sent to the client
Expand All @@ -82,16 +82,14 @@ def rejectingMethod(self, req):
origMethods.append(node.doDynamicValidation)
node.doDynamicValidation = types.MethodType(rejectingMethod, node)

reqs = sendRandomRequests(wallet1, client, tconf.Max3PCBatchSize)
waitForSufficientRepliesForRequests(looper, client, requests=reqs[:-1])
reqs = sdk_send_random_requests(looper, sdk_pool_handle,
sdk_wallet_client,
tconf.Max3PCBatchSize)
sdk_get_and_check_replies(looper, reqs[:-1])
with pytest.raises(RequestRejectedException) as e:
sdk_get_and_check_replies(looper, reqs[-1:])

with pytest.raises(AssertionError):
waitForSufficientRepliesForRequests(looper, client, requests=reqs[-1:])

for node in txnPoolNodeSet:
looper.run(eventually(checkRejectWithReason, client,
'Simulated rejection', node.clientstack.name,
retryWait=1))
assert 'Simulated rejection' in e._excinfo[1].args[0]

for i, node in enumerate(txnPoolNodeSet):
node.doDynamicValidation = origMethods[i]