Skip to content

Commit

Permalink
WIP integration test uses flyovers in three different ways.
Browse files Browse the repository at this point in the history
  • Loading branch information
juagargi committed Jan 12, 2024
1 parent 2dca550 commit 5457c4a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
3 changes: 0 additions & 3 deletions tools/end2end_hbird/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ go_library(
"//pkg/private/common:go_default_library",
"//pkg/private/serrors:go_default_library",
"//pkg/private/util:go_default_library",
"//pkg/slayers/path/hummingbird:go_default_library",
"//pkg/snet:go_default_library",
"//pkg/snet/metrics:go_default_library",
"//pkg/snet/path:go_default_library",
"//pkg/sock/reliable:go_default_library",
"//private/keyconf:go_default_library",
"//private/topology:go_default_library",
"//private/tracing:go_default_library",
"//router/control:go_default_library",
"//tools/integration:go_default_library",
"//tools/integration/integrationlib:go_default_library",
"@com_github_opentracing_opentracing_go//:go_default_library",
Expand Down
34 changes: 26 additions & 8 deletions tools/end2end_hbird/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,21 +298,39 @@ func (c *client) attemptRequest(n int) bool {
defer span.Finish()
// Convert path to Hummingbird path
if path != nil {

// TODO: buy flyovers for existing path(s). This is done by the user asynchronously

// TODO: insert flyovers obtained from Mysten's library.

// TODO: using the reservations in the DB, create a hummingbird path

// // This works:
// reservation, err := hummingbird.NewReservation(
// hummingbird.WithScionPath(path, nil))
// if err != nil {
// logger.Error("Error converting path to Hummingbird", "err", err)
// return false
// }

// deleteme this doesn't work and should:
// reservations, err := c.sdConn.GetReservations(ctx, integration.Local.IA, remote.IA, 1, true)
// if err != nil {
// logger.Error("getting reservations from daemon", "err", err)
// return false
// }
// logger.Info("deleteme", "reservation count", len(reservations))
// _ = reservations
// reservation := reservations[0]

// deleteme this doesn't work and should:
flyovers, err := c.sdConn.ListFlyovers(ctx)
if err != nil {
logger.Error("listing flyovers", "err", err)
return false
}
reservation, err := hummingbird.NewReservation(
hummingbird.WithScionPath(path, nil))
hummingbird.WithScionPath(path, hummingbird.FlyoversToMap(flyovers)))
if err != nil {
logger.Error("Error converting path to Hummingbird", "err", err)
return false
}

decoded := reservation.DeriveDataPlanePath(16, time.Now())
logger.Info("deleteme", "reservation path", fmt.Sprintf("%+v", decoded))
raw := snetpath.Hummingbird{
Raw: make([]byte, decoded.Len()),
}
Expand Down
6 changes: 4 additions & 2 deletions tools/end2end_hbird_integration/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,10 @@ func createMockFlyovers(
},
Bw: BW,
StartTime: util.TimeToSecs(now),
Duration: 60, // 1 Minute
ResID: resIDPerIA, // unique per ia
// Duration: 60, // 1 Minute
// deleteme: change to 1 minute again
Duration: 300, // 1 Hour
ResID: resIDPerIA, // unique per ia
}

key0 := control.DeriveHbirdSecretValue(master0.Key0)
Expand Down

0 comments on commit 5457c4a

Please sign in to comment.