Ember+ loadable plugin
Source
/*
** Copyright (C) 2001-2024 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
package conn
import (
"net"
"testing"
"time"
"github.com/google/go-cmp/cmp"
"golang.zabbix.com/plugin/ember-plus/ember"
"golang.zabbix.com/sdk/errs"
"golang.zabbix.com/sdk/log"
)
func Test_connHandler_read(t *testing.T) {
t.Parallel()
type args struct {
message [][]byte
deadline int
}
tests := []struct {
name string
args args
want []byte
wantErr bool
}{
{
"+valid",
args{
[][]byte{
{
0x02, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x6c, 0x34, 0x95, 0x40, 0x00, 0x80, 0x06, 0x00, 0x00,
0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x27, 0x0e, 0xd8, 0x4f, 0x5f, 0x85, 0xe1, 0x0e,
0x46, 0x58, 0x3e, 0xfd, 0x50, 0x18, 0x27, 0xf9, 0x11, 0xbf, 0x00, 0x00, 0xfe, 0x00, 0x0e, 0x00,
0x01, 0xc0, 0x01, 0x02, 0x1e, 0x02, 0x60, 0x34, 0x6b, 0x32, 0xa0, 0x30, 0x63, 0x2e, 0xa0, 0x03,
0x02, 0x01, 0x01, 0xa1, 0x27, 0x31, 0x25, 0xa0, 0x16, 0x0c, 0x14, 0x52, 0x33, 0x4c, 0x41, 0x59,
0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x50, 0x61, 0x74, 0x63, 0x68, 0x42, 0x61, 0x79, 0xa1,
0x02, 0x0c, 0x00, 0xa4, 0x02, 0x0c, 0x00, 0xa3, 0x03, 0x01, 0x01, 0xfd, 0xdf, 0xb5, 0x11, 0xff,
},
},
3,
},
[]byte{
0x60, 0x34, 0x6b, 0x32, 0xa0, 0x30, 0x63, 0x2e, 0xa0, 0x03, 0x02, 0x01, 0x01, 0xa1, 0x27, 0x31, 0x25,
0xa0, 0x16, 0x0c, 0x14, 0x52, 0x33, 0x4c, 0x41, 0x59, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x50,
0x61, 0x74, 0x63, 0x68, 0x42, 0x61, 0x79, 0xa1, 0x02, 0x0c, 0x00, 0xa4, 0x02, 0x0c, 0x00, 0xa3, 0x03,
0x01, 0x01, 0xff,
},