From de31d4ec7376a99fbc55857d32919d1e10937f9d Mon Sep 17 00:00:00 2001 From: DyrellC Date: Fri, 28 Feb 2020 13:27:23 -0700 Subject: [PATCH 1/2] Update pruning test for before and after pruning status --- .../machine6/6_local_snapshots_tests.feature | 22 ++++++++++++++++--- python-regression/util/static_vals.py | 13 ++++++----- .../util/test_logic/value_fetch_logic.py | 2 ++ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/python-regression/tests/features/machine6/6_local_snapshots_tests.feature b/python-regression/tests/features/machine6/6_local_snapshots_tests.feature index 11ea4a12d1..3202287df7 100644 --- a/python-regression/tests/features/machine6/6_local_snapshots_tests.feature +++ b/python-regression/tests/features/machine6/6_local_snapshots_tests.feature @@ -80,11 +80,27 @@ Feature: Test Bootstrapping With LS Takes a node with a large db and transaction pruning enabled, and checks to make sure that the transactions below the pruning depth are no longer present. - Given "checkConsistency" is called on "nodeD-m6" with: + Given "getInclusionStates" is called on "nodeD-m6" with: |keys |values |type | - |tails |LS_PRUNED_TRANSACTIONS |staticValue | + |transactions |LS_PRUNED_TRANSACTIONS |staticValue | + |tips |LS_PRUNING_TIP |staticList | - Then the response for "checkConsistency" should return null + And the response for "getInclusionStates" should return with: + |keys |values |type | + |states |True |boolList | + + # Trigger pruning and wait for it to finish + When the next 10 milestones are issued + And we wait "15" second/seconds + + And "getInclusionStates" is called on "nodeD-m6" with: + |keys |values |type | + |transactions |LS_PRUNED_TRANSACTIONS |staticValue | + |tips |LS_PRUNING_TIP |staticList | + + Then the response for "getInclusionStates" should return with: + |keys |values |type | + |states |False |boolList | Scenario: Check unconfirmed transaction is spent from diff --git a/python-regression/util/static_vals.py b/python-regression/util/static_vals.py index a4d332bd50..035ea262ae 100644 --- a/python-regression/util/static_vals.py +++ b/python-regression/util/static_vals.py @@ -118,12 +118,13 @@ ] LS_PRUNED_TRANSACTIONS = [ - "FKGOUSFWFWSPQXPGEVBXQRYFRGFJWBXRYCXJDZTQWQBQKUJOGEY9JCIVYYSHGNFVIJBIXMZIVDUPBUIYA", - "EVQEKYWYYDSPHYDVPHATRUHBMKANTTIRA9FXXUYSVRBSEMESKWDBJBWBDARWMGBCFWGI9CFOEI9MXGMYX", - "HVGYYBVCBWKSMQFTFURLQWWRTNBKYXMXQ9QP9SHSNZJQQ9P9HL9IGNWZBTNMOOLV9GVOBPIBEUCXWNFAY", - "KESYDCSVJ9TJJIOIMHJDMD9BSPWHQVUIKEBSMYLBTUZZTKKFALDTMATCQWAKIQHNHHZLP9NJFZJMFNEMC", - "TJRXEMZZMORIHQSGOTRUFATRMMQF9NCGVVCKIDJFIMEZNXFGC9HZQQWZXTMIWILGYBBBFZURU99G9YRLY" -] + "ZUGEWWWKGETGGVVVTXYFSMAP9KLRYQJSVHNTYWEXQONNNHTCMAMQANEPEFKNAJYRFJINTSHXTGFOWYWO9", + "UXBNYASZOCIGHTDTGHLJWRMUHXABNDSTDFVJLBIA9SMGYEFYZLKQETFIAERHSY9YZVUEJUMCTNQE9NIMY", + "XJZMRLGVXLIBAYPYWMZGXUZZWJEFAXRPGAAYIALSI9UBRSYDACGO9UEQJEOVROIBQMAMIFGZJHGHKUNNB", + "HDXVLKMJNKQNPTTSBETLNRY9WNWXILCTNICEEWEUKHKFFAHKA9D99XQCPQRHOVOBEYTLARJORYGMNHUOZ" + ] + +LS_PRUNING_TIP = "HO9YADXIDEUJUKOZYNWVRS9PWDXCFXNVM9LEGPZMBJSJKKQAZBFPXYMH9VABBG9NLNIDQPDLVWDKOEAOW" UNCONFIRMED_TEST_ADDRESS = [ "OXKSHMEQYDMJMDPJX9FIEJVWOKCROTCBRPCDCCSBPMZ9EEQMHTEDSDKIKAMZTYNYWIIMZBFY9IXBUGTZD" diff --git a/python-regression/util/test_logic/value_fetch_logic.py b/python-regression/util/test_logic/value_fetch_logic.py index 3dede4a655..9f662cb37c 100644 --- a/python-regression/util/test_logic/value_fetch_logic.py +++ b/python-regression/util/test_logic/value_fetch_logic.py @@ -121,6 +121,8 @@ def fetch_bool_list(value): node = world.config['nodeId'] response = world.responses[api_call][node] + keys = list(response.keys()) + response = response[keys[0]] if value == "False": return [False] * len(response) From b42f1308d37b4f8edf1c14ede0fce7dd4e46a5ff Mon Sep 17 00:00:00 2001 From: DyrellC Date: Mon, 6 Apr 2020 16:38:37 -0600 Subject: [PATCH 2/2] m6 -> m1 --- .../tests/features/machine1/1_local_snapshots_tests.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-regression/tests/features/machine1/1_local_snapshots_tests.feature b/python-regression/tests/features/machine1/1_local_snapshots_tests.feature index 4e920a04a2..31a6236f1e 100644 --- a/python-regression/tests/features/machine1/1_local_snapshots_tests.feature +++ b/python-regression/tests/features/machine1/1_local_snapshots_tests.feature @@ -80,7 +80,7 @@ Feature: Test Bootstrapping With LS Takes a node with a large db and transaction pruning enabled, and checks to make sure that the transactions below the pruning depth are no longer present. - Given "getInclusionStates" is called on "nodeD-m6" with: + Given "getInclusionStates" is called on "nodeD-m1" with: |keys |values |type | |transactions |LS_PRUNED_TRANSACTIONS |staticValue | |tips |LS_PRUNING_TIP |staticList | @@ -93,7 +93,7 @@ Feature: Test Bootstrapping With LS When the next 10 milestones are issued And we wait "15" second/seconds - And "getInclusionStates" is called on "nodeD-m6" with: + And "getInclusionStates" is called on "nodeD-m1" with: |keys |values |type | |transactions |LS_PRUNED_TRANSACTIONS |staticValue | |tips |LS_PRUNING_TIP |staticList |