PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
test_cyclicCapture.cpp File Reference

Golden cyclic-I/O regression tests backed by Wireshark PCAPNG captures. More...

#include <gtest/gtest.h>
#include <algorithm>
#include <array>
#include <condition_variable>
#include <cstdint>
#include <filesystem>
#include <fstream>
#include <functional>
#include <iterator>
#include <memory>
#include <mutex>
#include <numeric>
#include <optional>
#include <stdexcept>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#include "mocks/mockRawEthernetSocket.h"
#include "profinet/cyclic.h"
#include "profinet/gsdml.h"
#include "profinet/protocol.h"
#include "profinet/rpc.h"
#include "profinet/rt.h"
#include "profinet/util.h"
#include "stubs/stubRpcTransport.h"
+ Include dependency graph for test_cyclicCapture.cpp:

Go to the source code of this file.

Namespaces

namespace  profinet
 
namespace  profinet::CyclicCaptureTests
 

Functions

 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, PhoenixToAumaCaptureHasExpectedCyclicContract)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, SetValveOpenContainsOneSecondOpenCommand)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, SetValveCloseContainsOneSecondCloseCommand)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, CapturesUseExpectedPhoenixAndAumaMacAddresses)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, EveryCapturedCyclicRtFrameRoundTrips)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, AumaGsdmlMatchesCapturedProcessData)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, PhoenixGsdmlMatchesCapturedControllerIdentity)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, CommandByteIsAtEthernetByteTwentyFive)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, AumaGsdmlResolvesCompletePhoenixAumaSlotSet)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, DISABLED_BuildIocrConfigsMatchesPhoenixAumaWireLayout)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, DISABLED_WIPRtBuildIocrConfigsMatchesPhoenixAumaWireLayout)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, CyclicControllerTransmitsCapturedCloseCommand)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, CyclicControllerReceivesCapturedAumaPosition)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, DISABLED_BuildInputIocrBlockMatchesPhoenixAumaCapture)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, DISABLED_BuildOutputIocrBlockMatchesPhoenixAumaCapture)
 
 profinet::CyclicCaptureTests::TEST (CyclicCaptureTests, BuildExpectedSubmoduleBlocksMatchPhoenixAumaCapture)
 

Detailed Description

Golden cyclic-I/O regression tests backed by Wireshark PCAPNG captures.

These tests use the real Layer-2 captures produced while a Phoenix AXC F 1252 and an AUMA SGx exchanged PROFINET RT cyclic data.

The captures are intentionally treated as the wire-level golden reference:

  • Phoenix MAC: a8:74:1d:44:7a:bb.
  • AUMA MAC: a0:d3:85:00:f6:13.
  • EtherType: 0x8892.
  • Frame ID 0x8001 carries a 40-byte C_SDU in these captures.
  • Frame ID 0x9000 carries a 43-byte C_SDU in these captures.
  • The close/open command is at C_SDU offset 8, Ethernet byte 25.
  • The AUMA position is at C_SDU offsets 3 and 4.
Note
The physical source/destination MAC direction in the captures is the opposite of the conventional "controller produces outputs" interpretation of the IOCR direction. The regression tests deliberately preserve the observed wire direction and do not reinterpret it.

Definition in file test_cyclicCapture.cpp.

Variable Documentation

◆ aumaToPhoenix

std::vector<CapturedPacket> aumaToPhoenix

Definition at line 91 of file test_cyclicCapture.cpp.

◆ condition

std::condition_variable condition
private

Definition at line 769 of file test_cyclicCapture.cpp.

◆ controller

std::unique_ptr<cyclic::CyclicController> controller
private

Definition at line 760 of file test_cyclicCapture.cpp.

Referenced by profinet::cyclic::CyclicControllerTestAccess::FirstOutputByte(), profinet::cyclic::CyclicControllerTestAccess::FirstOutputIocs(), profinet::cyclic::CyclicControllerTestAccess::HandleWatchdogTimeout(), profinet::cyclic::CyclicControllerTestAccess::InputObject(), profinet::cyclic::CyclicControllerTestAccess::IocsGood(), profinet::cyclic::CyclicControllerTestAccess::ProcessInputFrame(), profinet::cyclic::CyclicControllerTestAccess::ResetRxSocket(), profinet::cyclic::CyclicControllerTestAccess::ResetTxSocket(), profinet::cyclic::CyclicControllerTestAccess::RxLoop(), profinet::sim::VirtualProfinetRpcDevice::SendApplicationReady(), profinet::cyclic::CyclicControllerTestAccess::SendOutputFrame(), profinet::cyclic::CyclicControllerTestAccess::SendStopFrames(), profinet::cyclic::CyclicControllerTestAccess::SetAllOutputIocs(), profinet::cyclic::CyclicControllerTestAccess::SetIocsGood(), profinet::cyclic::CyclicControllerTestAccess::SetMaxConsecutiveTimeouts(), profinet::cyclic::CyclicControllerTestAccess::SetRunning(), profinet::cyclic::CyclicControllerTestAccess::SetRxCounterStep(), profinet::cyclic::CyclicControllerTestAccess::SetRxSock(), profinet::cyclic::CyclicControllerTestAccess::SetState(), profinet::cyclic::CyclicControllerTestAccess::SetTxSock(), profinet::device::ProfinetDevice::StartCyclic(), profinet::cyclic::CyclicControllerTestAccess::Stats(), profinet::cyclic::CyclicControllerTestAccess::SwapOutputBuilder(), profinet::CyclicCaptureTests::TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::device::TEST_F(), profinet::cyclic::CyclicControllerTestAccess::TrackCycleCounter(), profinet::cyclic::CyclicControllerTestAccess::Transition(), profinet::cyclic::CyclicControllerTestAccess::TxCycle(), and profinet::cyclic::CyclicControllerTestAccess::TxLoop().

◆ frame

Bytes frame
Examples
/home/runner/work/rhmarine-oefenen/rhmarine-oefenen/profinet-io-controller-stack/include/profinet/util.h.

Definition at line 85 of file test_cyclicCapture.cpp.

Referenced by profinet::cyclic::ReceivedIopsTest::BuildInputFrame(), profinet::AsioEthernetSocket::EthernetPacketBackend::CaptureNextFrame(), profinet::AsioEthernetSocket::EthernetPacketBackend::CompleteHandler(), profinet::sim::InMemoryEthernetSocket::Enqueue(), profinet::AlarmListenerRtaTest::Feed(), profinet::AlarmListenerRtaIntegrationTest::Feed(), profinet::AlarmListenerCallbackTest::Feed(), profinet::cyclic::CyclicControllerTestAccess::FirstOutputIocs(), profinet::AsioEthernetSocket::EthernetPacketBackend::HandlePacketReady(), profinet::rt::RtFrameTest::MakeFrame(), profinet::EthernetPacketBackendTestFixture::MatchesEtherType(), profinet::AsioEthernetSocket::EthernetPacketBackend::MatchesEtherType(), profinet::sim::VirtualAumaValve::NotifyFrame(), profinet::AlarmListenerRtaTest::ParseSentFrame(), profinet::cyclic::CyclicController::ProcessInputFrame(), profinet::sim::VirtualAumaValve::ProcessOutputFrame(), profinet::sim::InMemoryEthernetSocket::Recv(), profinet::sim::VirtualAumaValve::Run(), profinet::AsioEthernetSocket::EthernetPacketBackend::Send(), profinet::AsioEthernetSocket::Send(), profinet::sim::InMemoryEthernetSocket::Send(), profinet::sim::VirtualAumaValve::SendInputFrame(), profinet::cyclic::CyclicController::SendOutputFrame(), profinet::AlarmListener::SendRtaFrame(), profinet::dcp::SetParam(), profinet::dcp::SignalDevice(), profinet::SkipVlanTags(), profinet::CyclicCaptureTests::TEST(), profinet::CyclicCaptureTests::TEST(), profinet::CyclicCaptureTests::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), TEST_F(), profinet::dcp::TEST_F(), profinet::dcp::TEST_F(), profinet::dcp::TEST_F(), profinet::dcp::TEST_F(), profinet::dcp::TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), profinet::rpc::TEST_F(), profinet::rt::TEST_F(), profinet::rt::TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and profinet::sim::InMemoryEthernetBus::Transmit().

◆ ioContext

◆ mutex

std::mutex mutex
mutableprivate

Definition at line 768 of file test_cyclicCapture.cpp.

Referenced by profinet::sim::TEST().

◆ phoenixToAuma

std::vector<CapturedPacket> phoenixToAuma

Definition at line 90 of file test_cyclicCapture.cpp.

◆ rx

◆ rxFrame

Bytes rxFrame
private

Definition at line 770 of file test_cyclicCapture.cpp.

◆ rxSocket

◆ sentFrames

std::vector<Bytes> sentFrames
private

Definition at line 771 of file test_cyclicCapture.cpp.

◆ timestampNs

std::uint64_t timestampNs = 0U

Definition at line 84 of file test_cyclicCapture.cpp.

◆ tx

◆ txSocket