From c11e6765727b6e14c087582542f2f30509037d73 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 15 May 2015 00:51:57 +0200 Subject: [PATCH] tests: fix typo in SNMP checks with protocol identity --- src/daemon/agent.c | 4 ++-- tests/check_snmp.c | 18 ++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/daemon/agent.c b/src/daemon/agent.c index b22cfade..b58b4968 100644 --- a/src/daemon/agent.c +++ b/src/daemon/agent.c @@ -454,7 +454,7 @@ header_ppiindexed_table(struct variable *vp, oid *name, size_t *length, TAILQ_FOREACH(pi, &hardware->h_lport.p_pids, p_entries) { oid index[2] = { hardware->h_ifindex, frame_checksum((const u_char*)pi->p_pi, - pi->p_pi_len, 0) }; + pi->p_pi_len, 0) }; if (header_index_add(index, 2, pi)) return pi; @@ -480,7 +480,7 @@ header_tprpiindexed_table(struct variable *vp, oid *name, size_t *length, hardware->h_ifindex, port->p_chassis->c_index, frame_checksum((const u_char *)pi->p_pi, - pi->p_pi_len, 0) }; + pi->p_pi_len, 0) }; if (header_index_add(index, 4, pi)) return pi; diff --git a/tests/check_snmp.c b/tests/check_snmp.c index b0bd45ba..7ff6d134 100644 --- a/tests/check_snmp.c +++ b/tests/check_snmp.c @@ -277,7 +277,7 @@ struct lldpd_pi pi88cc = { .p_pi_len = 2, }; struct lldpd_pi pi888e01 = { - .p_pi = "\x88\x8e\e01", + .p_pi = "\x88\x8e\x01", .p_pi_len = 3, }; #endif @@ -296,7 +296,6 @@ struct lldpd_port port2 = { void snmp_config() { - starttime = test_starttime; agent_scfg = &test_cfg; TAILQ_INIT(&test_cfg.g_chassis); @@ -333,7 +332,6 @@ snmp_config() TAILQ_INSERT_TAIL(&hardware1.h_rports, &hardware2.h_lport, p_entries); TAILQ_INIT(&hardware2.h_rports); TAILQ_INSERT_TAIL(&hardware2.h_rports, &hardware1.h_lport, p_entries); - } /* Convert OID to a string. Static buffer. */ @@ -816,10 +814,10 @@ struct tree_node snmp_tree[] = { { { 1, 5, 32962, 1, 2, 3, 1, 2, 3, 1449}, 10, ASN_OCTET_STR, { .string = { .octet = "VLAN #1449", .len = 10 }} }, /* lldpXdot1LocProtocolId */ - { { 1, 5, 32962, 1, 2, 4, 1, 2, 3, 13175}, 10, ASN_OCTET_STR, + { { 1, 5, 32962, 1, 2, 4, 1, 2, 3, 30321}, 10, ASN_OCTET_STR, + { .string = { .octet = "\x88\x8e\x01", .len = 3 } }}, + { { 1, 5, 32962, 1, 2, 4, 1, 2, 3, 30515}, 10, ASN_OCTET_STR, { .string = { .octet = "\x88\xcc", .len = 2 } }}, - { { 1, 5, 32962, 1, 2, 4, 1, 2, 3, 29020}, 10, ASN_OCTET_STR, - { .string = { .octet = "\x88\x8e\e01", .len = 3 } }}, /* lldpXdot1RemPortVlanId */ { { 1, 5, 32962, 1, 3, 1, 1, 1, 0, 3, 1}, 11, ASN_INTEGER, { .integer = 0 }}, @@ -839,10 +837,10 @@ struct tree_node snmp_tree[] = { { { 1, 5, 32962, 1, 3, 3, 1, 2, 10000, 4, 1, 1449}, 12, ASN_OCTET_STR, { .string = { .octet = "VLAN #1449", .len = 10 }} }, /* lldpXdot1RemProtocolId */ - { { 1, 5, 32962, 1, 3, 4, 1, 2, 10000, 4, 1, 13175}, 12, ASN_OCTET_STR, - { .string = { .octet = "\x88\xcc", .len = 2 } }}, - { { 1, 5, 32962, 1, 3, 4, 1, 2, 10000, 4, 1, 29020}, 12, ASN_OCTET_STR, - { .string = { .octet = "\x88\x8e\e01", .len = 3 } }}, + { { 1, 5, 32962, 1, 3, 4, 1, 2, 10000, 4, 1, 30321}, 12, ASN_OCTET_STR, + { .string = { .octet = "\x88\x8e\x01", .len = 3 } }}, + { { 1, 5, 32962, 1, 3, 4, 1, 2, 10000, 4, 1, 30515}, 12, ASN_OCTET_STR, + { .string = { .octet = "\x88\xcc", .len = 2 } }} #endif }; -- 2.39.5