This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tango-tsg-service-chaining-…/test/gtest_ctrl_pkt_opening.cpp

36 lines
1.5 KiB
C++
Raw Permalink Normal View History

#include "gtest_utils.h"
// 99 bytes
static u_char ctrl_pkt_opening[] = {
0x48, 0x73, 0x97, 0x96, 0x38, 0x10, 0x0c, 0xa7, 0x5c, 0x64, 0x00, 0x01, 0x08, 0x00, 0x45, 0x00,
0x00, 0x6c, 0xff, 0xde, 0x40, 0x00, 0x33, 0x06, 0x27, 0xea, 0xc0, 0xa8, 0x29, 0x40, 0x5d, 0xb8,
0xd8, 0x22, 0xce, 0xec, 0x00, 0x50, 0xf8, 0x77, 0x0d, 0xcf, 0x00, 0x00, 0x00, 0x00, 0x50, 0x18,
0x03, 0xec, 0x08, 0xa7, 0x00, 0x00,
// msg payload
0x83, 0xA5, 0x74, 0x73, 0x79, 0x6E, 0x63, 0xA3, 0x32, 0x2E, 0x30, 0xAA, 0x73, 0x65, 0x73, 0x73,
0x69, 0x6F, 0x6E, 0x5F, 0x69, 0x64, 0xCF, 0x04, 0x08, 0x02, 0x1B, 0x68, 0x4C, 0x03, 0xE9, 0xA5,
0x73, 0x74, 0x61, 0x74, 0x65, 0xA7, 0x6F, 0x70, 0x65, 0x6E, 0x69, 0x6E, 0x67};
TEST(PACKET_IO, CTRL_PKT_OPENING)
{
marsio_buff_t *tx_mbuf = NULL;
marsio_buff_t *dup_mbuf = NULL;
struct gtest_frame *gtest_frame = NULL;
build_mbuf_for_ctrl_pkt(tx_mbuf, ctrl_pkt_opening, sizeof(ctrl_pkt_opening), 290484492702581737, 54);
dup_mbuf = marsio_mbuff_dup(tx_mbuf);
gtest_frame = gtest_frame_new("sce0.json", "ctr_pkt_opening");
gtest_frame_run(gtest_frame, tx_mbuf, dup_mbuf, 1);
gtest_frame_log(gtest_frame);
marsio_buff_free(packet_io_get_mr_instance(gtest_frame->sce_ctx->io), &tx_mbuf, 1, 0, 0);
marsio_buff_free(packet_io_get_mr_instance(gtest_frame->sce_ctx->io), &dup_mbuf, 1, 0, 0);
gtest_frame_free(gtest_frame);
}
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}