lsps2: add integration tests

This commit is contained in:
Jesse de Wit
2023-09-04 20:38:26 +02:00
parent 9fed9a1e68
commit ba1e4074eb
11 changed files with 467 additions and 23 deletions

View File

@@ -18,8 +18,14 @@ func TestLspd(t *testing.T) {
return
}
testCases := allTestCases
runTests(t, testCases, "LND-lsp-CLN-client", lndLspFunc, clnClientFunc)
runTests(t, testCases, "LND-lsp-LND-client", legacyOnionLndLspFunc, lndClientFunc)
var lndTestCases []*testCase
for _, c := range testCases {
if !c.isLsps2 {
lndTestCases = append(lndTestCases, c)
}
}
runTests(t, lndTestCases, "LND-lsp-CLN-client", lndLspFunc, clnClientFunc)
runTests(t, lndTestCases, "LND-lsp-LND-client", legacyOnionLndLspFunc, lndClientFunc)
runTests(t, testCases, "CLN-lsp-CLN-client", clnLspFunc, clnClientFunc)
}
@@ -117,6 +123,7 @@ type testCase struct {
name string
test func(t *testParams)
skipCreateLsp bool
isLsps2 bool
timeout time.Duration
}
@@ -179,19 +186,44 @@ var allTestCases = []*testCase{
test: testOfflineNotificationZeroConfChannel,
},
{
name: "testLsps0GetProtocolVersions",
test: testLsps0GetProtocolVersions,
name: "testLsps0GetProtocolVersions",
test: testLsps0GetProtocolVersions,
isLsps2: true,
},
{
name: "testLsps2GetVersions",
test: testLsps2GetVersions,
name: "testLsps2GetVersions",
test: testLsps2GetVersions,
isLsps2: true,
},
{
name: "testLsps2GetInfo",
test: testLsps2GetInfo,
name: "testLsps2GetInfo",
test: testLsps2GetInfo,
isLsps2: true,
},
{
name: "testLsps2Buy",
test: testLsps2Buy,
name: "testLsps2Buy",
test: testLsps2Buy,
isLsps2: true,
},
{
name: "testLsps2HappyFlow",
test: testLsps2HappyFlow,
isLsps2: true,
},
{
name: "testLsps2Cltv",
test: testLsps2Cltv,
isLsps2: true,
},
{
name: "testLsps2NoBalance",
test: testLsps2NoBalance,
isLsps2: true,
},
{
name: "testLsps2ZeroConfUtxo",
test: testLsps2ZeroConfUtxo,
isLsps2: true,
skipCreateLsp: true,
},
}