forked from rosa/hakurei
cmd/mbf: optionally ignore reply
An acknowledgement is not always required in this use case. This change also adds 64 bits of connection configuration for future expansion. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"io"
|
||||
"log"
|
||||
@@ -17,7 +18,7 @@ import (
|
||||
"hakurei.app/message"
|
||||
)
|
||||
|
||||
func TestCureFromIR(t *testing.T) {
|
||||
func TestNoReply(t *testing.T) {
|
||||
t.Parallel()
|
||||
if !daemonDeadline().IsZero() {
|
||||
t.Fatal("daemonDeadline did not return the zero value")
|
||||
@@ -45,7 +46,11 @@ func TestCureFromIR(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
|
||||
if _err := c.EncodeAll(
|
||||
if _, _err := client.Write(
|
||||
binary.LittleEndian.AppendUint64(nil, remoteNoReply),
|
||||
); _err != nil {
|
||||
panic(_err)
|
||||
} else if _err = c.EncodeAll(
|
||||
client,
|
||||
pkg.NewFile("check", []byte{0}),
|
||||
); _err != nil {
|
||||
@@ -105,7 +110,7 @@ func TestDaemon(t *testing.T) {
|
||||
}()
|
||||
|
||||
var p *check.Absolute
|
||||
p, err = cureRemote(ctx, &addr, pkg.NewFile("check", []byte{0}))
|
||||
p, err = cureRemote(ctx, &addr, pkg.NewFile("check", []byte{0}), 0)
|
||||
if err != nil {
|
||||
t.Fatalf("cureRemote: error = %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user