test(sharness): fix pubsub tests
Steven Allen committed
May 22, 2020 at 16:21 UTC
a4985c29e8f734e9755917c731823cde38514b02
1 file changed
+5
-33
test/sharness/t0180-pubsub.sh
+5
-33
@@ -106,25 +106,14 @@ test_expect_success 'stop iptb' '
106
107
# Test with some nodes not signing messages.
108
109
-test_expect_success 'disable signing on node 1' '
110
- ipfsi 1 config --json Pubsub.DisableSigning true
111
-'
112
-
113
-startup_cluster $NUM_NODES --enable-pubsub-experiment
114
-run_pubsub_tests
115
-test_expect_success 'stop iptb' '
116
- iptb stop
117
-'
118
-
119
-# Test strict message verification.
120
-
121
-test_expect_success 'enable strict signature verification on node 4' '
122
- ipfsi 4 config --json Pubsub.StrictSignatureVerification true
109
+test_expect_success 'disable signing on nodes 1-3' '
110
+ iptb run [0-3] -- ipfs config --json Pubsub.DisableSigning true
111
'
112
113
startup_cluster $NUM_NODES --enable-pubsub-experiment
114
115
test_expect_success 'set node 4 to listen on testTopic' '
116
+ rm -f node4_actual &&
117
ipfsi 4 pubsub sub --enc=ndpayload testTopic > node4_actual &
118
'
119
@@ -134,25 +123,8 @@ test_expect_success 'stop iptb' '
123
iptb stop
124
'
125
137
-test_expect_success 'node 4 only got the signed message' '
138
- echo "testOK2" > node4_expected &&
139
- test_cmp node4_actual node4_expected
140
-'
141
-
142
-# Test all nodes signing with strict verification
143
-
144
-test_expect_success 're-enable signing on node 1' '
145
- ipfsi 1 config --json Pubsub.DisableSigning false
146
-'
147
-
148
-test_expect_success 'enable strict signature verification on all nodes' '
149
- iptb run -- ipfs config --json Pubsub.StrictSignatureVerification true
150
-'
151
-
152
-startup_cluster $NUM_NODES --enable-pubsub-experiment
153
-run_pubsub_tests
154
-test_expect_success 'stop iptb' '
155
- iptb stop
126
+test_expect_success 'node 4 got no unsigned messages' '
127
+ test_must_be_empty node4_actual
128
'
129
130
test_done