summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2015-11-19 09:36:40 +0200
committerHanoh Haim <hhaim@cisco.com>2015-11-19 09:36:40 +0200
commit7af2e24f4eb76820f9c1c9aad841ab6c91d0435a (patch)
tree76a999c20e8f672f55c834ac2750b18353550cbb
parent95ad2382d2e1705f0a7881457aa8019916e7194f (diff)
another stream program tests
-rw-r--r--.gitignore1
-rw-r--r--scripts/exp/stl_simple_prog2-0-ex.erfbin0 -> 792 bytes
-rw-r--r--src/gtest/trex_stateless_gtest.cpp63
3 files changed, 63 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 2f3d1759..34c7060d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,7 @@ scripts/exp/stl_single_pkt_burst1-0.erf
scripts/exp/stl_single_sctp_pkt-0.erf
scripts/exp/stl_single_stream-0.erf
scripts/exp/stl_simple_prog1-0.erf
+scripts/exp/stl_simple_prog2-0.erf
diff --git a/scripts/exp/stl_simple_prog2-0-ex.erf b/scripts/exp/stl_simple_prog2-0-ex.erf
new file mode 100644
index 00000000..3ec46e2f
--- /dev/null
+++ b/scripts/exp/stl_simple_prog2-0-ex.erf
Binary files differ
diff --git a/src/gtest/trex_stateless_gtest.cpp b/src/gtest/trex_stateless_gtest.cpp
index cf80a50c..2e720255 100644
--- a/src/gtest/trex_stateless_gtest.cpp
+++ b/src/gtest/trex_stateless_gtest.cpp
@@ -110,7 +110,6 @@ public:
return (res);
}
-
public:
int m_threads;
double m_time_diff;
@@ -225,6 +224,68 @@ TEST_F(basic_stl, load_pcap_file) {
}
+TEST_F(basic_stl, simple_prog2) {
+
+ CBasicStl t1;
+ CParserOption * po =&CGlobalInfo::m_options;
+ po->preview.setVMode(7);
+ po->preview.setFileWrite(true);
+ po->out_file ="exp/stl_simple_prog2";
+
+ TrexStreamsCompiler compile;
+
+
+ std::vector<TrexStream *> streams;
+
+ /* stream1 */
+ TrexStream * stream1 = new TrexStream(TrexStream::stSINGLE_BURST, 0,100);
+ stream1->set_pps(1.0);
+ stream1->set_single_burst(5);
+ stream1->m_enabled = true;
+ stream1->m_self_start = true;
+ stream1->m_next_stream_id=200;
+
+ CPcapLoader pcap;
+ pcap.load_pcap_file("cap2/udp_64B.pcap",0);
+ pcap.update_ip_src(0x10000001);
+ pcap.clone_packet_into_stream(stream1);
+
+ streams.push_back(stream1);
+
+
+ /* stream1 */
+
+ TrexStream * stream2 = new TrexStream(TrexStream::stSINGLE_BURST, 0,200);
+ stream2->set_pps(1.0);
+ stream2->set_single_burst(5);
+ stream2->m_isg_usec = 2000000; /*time betwean stream 1 to stream 2 */
+ stream2->m_enabled = true;
+ stream2->m_self_start = false;
+
+ pcap.load_pcap_file("cap2/udp_64B.pcap",0);
+ pcap.update_ip_src(0x10000002);
+ pcap.clone_packet_into_stream(stream2);
+ streams.push_back(stream2);
+
+
+ TrexStreamsCompiledObj comp_obj(0,1.0);
+
+ EXPECT_TRUE(compile.compile(streams, comp_obj) );
+
+ TrexStatelessDpStart * lpstart = new TrexStatelessDpStart( comp_obj.clone(), 10.0 );
+
+
+ t1.m_msg = lpstart;
+
+ bool res=t1.init();
+
+ delete stream1 ;
+ delete stream2 ;
+
+ EXPECT_EQ_UINT32(1, res?1:0)<< "pass";
+}
+
+
TEST_F(basic_stl, simple_prog1) {