[service] Add check for kext command size

This commit is contained in:
Vladimir Stoilov
2024-06-28 13:20:18 +03:00
parent 176494550e
commit 4bf1736a83
6 changed files with 186 additions and 55 deletions

View File

@@ -18,8 +18,17 @@ func TestRustInfoFile(t *testing.T) {
defer func() {
_ = file.Close()
}()
first := true
for {
info, err := RecvInfo(file)
// First info should be with invalid size.
if first {
if !errors.Is(err, ErrUnexpectedInfoSize) {
t.Errorf("unexpected error: %s\n", err)
}
first = false
continue
}
if err != nil {
if errors.Is(err, ErrUnexpectedReadError) {
t.Errorf("unexpected error: %s\n", err)