Commit Graph

187 Commits

Author SHA1 Message Date
Conner Fromknecht
36f0eb2799
lnd_test: move retribution tests after switch persistence 2018-03-12 14:46:29 -07:00
Conner Fromknecht
6b74e28858
lnd_test: adds advanced switch persistence test, checking:
//   1. Carol --> Dave --> Alice --> Bob  forward payment
//   2. Carol --- Dave  X  Alice --- Bob  disconnect intermediaries
//   3. Carol --- Dave  X  Alice <-- Bob  settle last hop
//   4. Carol --- Dave  X         X       shutdown Bob, restart Alice
//   5. Carol <-- Dave <-- Alice  X       expect settle to propagate
2018-03-09 21:18:17 -08:00
Conner Fromknecht
38b04ec357
lnd_test: adds switch offline delivery outgoing offline itest 2018-03-09 21:18:16 -08:00
Conner Fromknecht
cf0ab41ce8
lnd_test: adds sphinx replay and switch persistence tests 2018-03-09 21:18:16 -08:00
Conner Fromknecht
58324e0d38
lnd_test: add wait predicate to retribution balance check 2018-03-09 21:18:16 -08:00
Conner Fromknecht
e1745f72aa
lnd_test: bump async bidrect timeout to account sphinx replay writes 2018-03-08 21:12:05 -05:00
Olaoluwa Osuntokun
643159caff
test: extend testMultiHopPayments to check feereport and forwarding history 2018-03-06 13:56:13 -05:00
Johan T. Halseth
b9f09a666d
lnd test: calculate channel reserve based on balance before fees 2018-02-26 22:42:27 +01:00
Johan T. Halseth
f42c16b612
lnd test: ensure static fee is not rounded down 2018-02-26 22:42:27 +01:00
Johan T. Halseth
78514acd49
integration tests: accoount for channel reserve when sending payments. 2018-02-08 18:35:24 -05:00
practicalswift
a93736d21e multi: comprehensive typo fixes across all packages 2018-02-06 19:11:11 -08:00
Wilmer Paulino
f674e10a2b
lnd+cmd/lncli: handle ChannelPoint funding txid proto update
Since a ChannelPoint's funding txid can now be get/set as raw bytes or
a string, we first need to check what type it's currently set to before
accessing it.
2018-01-27 22:00:01 -05:00
Johan T. Halseth
764323eb69
integration tests: use wait predicate to get Bob balance 2018-01-24 11:12:52 +01:00
Johan T. Halseth
786ca6cc50
integration test: improve logging in case of channel announcement failure 2018-01-24 10:26:29 +01:00
Olaoluwa Osuntokun
2d104b7ec0
test: wait for 2 transactions to enter mempool at the end of testMultiHopHtlcRemoteChainClaim
In this commit, we fix an existing flake on Travis related to the new
set of on-chain HTLC tests. In this timing flake, Bob would broadcast
his sweeping transaction, but *mid block mining*. As a result, the
output would never be properly swept, needing an additional block to be
mined. We’ll now wait for both Bob’s sweeping transaction, and Carol’s
sweep transaction to be confirmed before we attempt our assertions.
2018-01-23 19:05:36 -08:00
Olaoluwa Osuntokun
5dc0d669a6
contractcourt: watch proper output within htlcOutgoingContestResolver
In this commit, we fix an existing bug in the implementation of the
resolution of the htlcOutgoingContestResolver. Before this commit, we
would _always_ watch the claim outpoint. However, if this is on the
remote party’s commitment transaction, then we would end up watching
the wrong output. We’ll now properly detect this by modifying which
output we watch, based on if we have a second level transaction or not.
2018-01-23 14:16:22 -08:00
Olaoluwa Osuntokun
dd08662c87
test: fix linter error 2018-01-22 21:11:34 -08:00
Olaoluwa Osuntokun
d0abb8219c
test: wrap assertion in WaitPredicate in testMultiHopReceiverChainClaim 2018-01-22 21:06:39 -08:00
Olaoluwa Osuntokun
99cc4be448
test: extend timeouts for WaitPredicate on new integration tests 2018-01-22 20:37:32 -08:00
Olaoluwa Osuntokun
968e3e953e
test: extend timeouts on new on-chain htlc integration tests for travis 2018-01-22 19:58:19 -08:00
Olaoluwa Osuntokun
f8adab1f1c
test: add comprehensive integration tests for on-chain HTLC handling
In this commit, we add 6 new integration tests to test the various
actions that may need to be performed when either side goes on-chain to
fully resolve HTLC’s. Many of the tests are mirrors of each other as
they test sweeping/resolving HTLC’s from both commitment transactions.
2018-01-22 19:20:02 -08:00
Olaoluwa Osuntokun
a1e2560b12
test: modify force close integration test to account for recent HTLC changes
In this commit, we modify the testChannelForceClosure integration test
to account for the fact that now the HTLCs are only sent to the nursery
once they’ve fully timed out. Additionally, we now send Carol HTLCs
that she doesn’t know the preimage to, so she doesn’t attempt to sweep
them before we can actually time them out.
2018-01-22 19:20:01 -08:00
Johan T. Halseth
d030773c8d
lnd test: add testUpdateChannelPolicy
This commit adds a new integration test, that checks that
policy/fee updates get propagated properly in the network,
such that the other nodes learn about the changes.
2018-01-12 22:57:05 +01:00
Johan T. Halseth
f4f024aff2
lnd_test: extract graph topology subscription into own method
This commit extracts the launching of a goroutine subscribing
to and forwarding graph topology notifications into its own
utility method, such that it can be used in other tests as
well.
2018-01-12 22:57:04 +01:00
Johan T. Halseth
f1c6d40db8
lnd_test: use defaultBitcoinTimeLockDelta instead of defaultBitcoinForwardingPolicy.TimeLockDelta 2018-01-12 22:56:42 +01:00
Johan T. Halseth
4a1a9d6b14
lnd_test: add name of testcase to node's logfile
This commit adds a line of text including a test case's
name to Alice's and Bob's logfiles during integration
tests, making it easier to seek for the place in the log
where the specific tests start.
2018-01-09 12:59:32 +01:00
Olaoluwa Osuntokun
882b1313ba Merge remote-tracking branch 'origin/pr/445' 2018-01-06 17:22:30 -08:00
Johan T. Halseth
1f19694f50 integration tests: add test for private channels
This commit adds a new test, that in a small network
of 4 nodes, tests that a private channel can be used
for routing payments by the endpoints of the channel,
while the existence of the channel is not known to
the rest of the network.
2018-01-06 17:21:49 -08:00
Conner Fromknecht
978c0dc512
lnd_test: adds polling num channels assertion in breach itests 2018-01-05 13:47:18 -08:00
Olaoluwa Osuntokun
7421584341
lnrpc: making PendingChannels req/resp naming scheme consistent
In this commit we rename the lnrpc.PendingChannelRequest and
lnrpc.PendingChannelResponse to
lnrpc.PendingChannelsRequest/lnrpc.PendingChannelsResponse. We do this
as we strive to ensure that the naming scheme across the RPC interface
is consistent.
2018-01-04 14:20:31 -06:00
Olaoluwa Osuntokun
b74b9fc16e
test: extend time outs in flaky tests due to Travis CI instance speed variance 2017-12-22 19:43:50 +01:00
Olaoluwa Osuntokun
a93be76d16
test: extend timeouts within testRevokedCloseRetribution tests 2017-12-21 11:44:46 +01:00
Olaoluwa Osuntokun
e0c292d960
Merge pull request #486 from cfromknecht/invoice-itest-cancel
lnd_test: invoice subscription cancel lingering goroutine
2017-12-17 18:42:36 -08:00
Olaoluwa Osuntokun
3bf4b5a830
Merge pull request #489 from cfromknecht/force-close-complete-payreq
lnd_test: use completePaymentRequests in channel force close itest
2017-12-17 18:41:01 -08:00
Johan T. Halseth
fa5b5521bf lnd_test: update integration tests for 6 block channel announcements 2017-12-17 18:35:34 -08:00
Jim Posen
84d7c7ee2c lntest: Refactor set up calls to NetworkHarness. 2017-12-14 20:06:23 -08:00
Jim Posen
19ed1fb8db lntest: Add ShutdownNode method to harness.
This is preferable to calling Shutdown on the node directly so that
the harness manages the entire lifecycle of an lnd process.
2017-12-14 20:06:23 -08:00
Jim Posen
43e501feb9 lntest: Rename structs with proper visibility so lnd_test runs. 2017-12-14 20:06:23 -08:00
Jim Posen
88dc73adb0 htlcswitch: Fix failure error handling on outgoing adds. 2017-12-14 17:53:58 -08:00
Conner Fromknecht
c273d83e71
lnd_test: invoice subscription cancel lingering goroutine
This commit adds a small cancellation check to the
invoice subscription integration test. Calls to
Fatalf were observed on travis after the test had
ended stemming from the subscriber's goroutine,
which could happen if the subscription is late.
It also extends the timeout on the test from 5 to
10 seconds.
2017-12-14 15:19:47 -08:00
Conner Fromknecht
932742e1f9
lnd_test: use completePaymentRequests in channel force close itest 2017-12-14 15:19:22 -08:00
Micah Lerner
0f3ff119e8 rpcserver: add SettleDate to rpcserver invoice response 2017-12-08 16:50:04 -08:00
Nalin Bhardwaj
eb13be9adf
tests: Modify to handle changes to WalletBalance response 2017-12-04 05:34:48 +05:30
Olaoluwa Osuntokun
c00a3ae03b
cmd/lncli: fix graph rendering with a single channel 2017-12-02 18:56:01 -08:00
Conner Fromknecht
2ef821ed9a
lnd_test: extends force closure test to test for outgoing htlc incubation 2017-11-16 16:16:00 -08:00
Jim Posen
78f8ddef72 lnd: Remove some sleeps in integration tests.
There is a sleep after channels are opened to ensure the channel is
removed from the set of pending reservations. We can avoid this sleep
and get better guarantees of the channel being opened by deleting the
reservation just before updating channel state to active instead of
after.
2017-11-13 20:52:07 -08:00
Jim Posen
c501da3a95 lnd: Context timeouts on SendPayment RPC request in tests.
This helps catch issues in the RPC tests faster by putting a timeout
on all SendPayment requests. Otherwise, if a payment stalled, the test
would run until the test suite timeout, 10 minutes. Also simplifies
some code with a helper function and using SendPaymentSync where
possible.
2017-11-13 20:52:07 -08:00
Jim Posen
643c23f978 lnd: Improve error handling for node failures in integration tests.
If an lnd node encounters a fatal process errors, we now log the error
asynchronously, instead of calling Fatalf on the test instance. This
is because calling Fatalf in a separate goroutine does not actually
end the test immediately as expected, but rather just kills the
goroutine. This ensures that we see server errors on all nodes before
the test process exits.
2017-11-13 20:52:07 -08:00
Olaoluwa Osuntokun
5a8ebb09f7
test: decrease amount sent in multi-hop error integration test
In this commit, we increase the initial amount sent in the multi-hop
error integration test. We must do this now as the Bandwidth() function
now takes into account the total fee paid within the commitment
transaction. This caused an earlier send to fail instead of the once
following send.

To fix this, we simply send less in the initial test case.
2017-11-10 19:51:14 -08:00
Olaoluwa Osuntokun
4c70135bb8
test: remove testChannelReestablishment integration test
This commit removes the testChannelReestablishment integration test as
it is currently incomplete. In order to properly test this, we require
some infrastructure that allows us to kill the connection at will once
a message is sent across the wire.
2017-11-10 19:51:14 -08:00