Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci test #1

Merged
merged 61 commits into from
Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
0c412ed
test #3
r9-pena Jul 14, 2021
21fa031
added branch for workflow test
r9-pena Jul 14, 2021
b6f8247
test #4
r9-pena Jul 14, 2021
e287452
test #4
r9-pena Jul 14, 2021
458e1f9
test #5
r9-pena Jul 14, 2021
793bb9b
test #6
r9-pena Jul 14, 2021
aca3f78
Test #7
r9-pena Jul 14, 2021
b38764e
test #8
r9-pena Jul 14, 2021
6dcdb5d
test #8
r9-pena Jul 14, 2021
b31b67a
Test #9
r9-pena Jul 14, 2021
93ab848
Test #9
r9-pena Jul 14, 2021
b825557
Test #10
r9-pena Jul 15, 2021
cd1f0c8
Test #11
r9-pena Jul 15, 2021
326bef6
Test #12
r9-pena Jul 15, 2021
b80827f
Test #13
r9-pena Jul 15, 2021
50c0cc3
Test #14
r9-pena Jul 15, 2021
ebe155d
Test #15
r9-pena Jul 20, 2021
d01f825
Test #16
r9-pena Jul 20, 2021
55f9c79
Test #17
r9-pena Jul 20, 2021
32d4de7
Test #18
r9-pena Jul 20, 2021
bf86771
Test #20
r9-pena Jul 20, 2021
7414f1b
Test #21
r9-pena Jul 20, 2021
442807d
Test #22
r9-pena Jul 20, 2021
322d7ce
Test #23
r9-pena Jul 20, 2021
f0a2f16
Test #24
r9-pena Jul 20, 2021
8bf818a
Test #25
r9-pena Jul 20, 2021
5ad6d77
Split test files
r9-pena Jul 20, 2021
87da673
Split tests #2
r9-pena Jul 20, 2021
0b04c18
Added executable permissions
r9-pena Jul 20, 2021
03e3871
Delete RPI.bash
r9-pena Jul 21, 2021
cf8aa08
Delete Ref.bash
r9-pena Jul 21, 2021
8e92aef
Delete Framework.bash
r9-pena Jul 21, 2021
74f1eb0
exe files
r9-pena Jul 21, 2021
941037f
Merge branch 'CI-test' of https://github.com/r9-pena/fprime into CI-test
r9-pena Jul 21, 2021
e92e714
Make Framework.bash executable
r9-pena Jul 21, 2021
a79165b
Make RPI.bash and Ref.bash executable
r9-pena Jul 21, 2021
b308206
Test #26
r9-pena Jul 21, 2021
7ade858
Test #27
r9-pena Jul 21, 2021
a31c10b
Test #28
r9-pena Jul 21, 2021
158ecab
Attached Integration test to Ref test
r9-pena Jul 22, 2021
aa26e28
Test #29
r9-pena Jul 22, 2021
90e2b47
Test #30
r9-pena Jul 22, 2021
b7edab7
Test #31
r9-pena Jul 23, 2021
2310583
Test #32
r9-pena Jul 23, 2021
1418ec5
Test #33
r9-pena Jul 23, 2021
b3e09c4
Test #34
r9-pena Jul 23, 2021
713760c
Test #35
r9-pena Jul 23, 2021
6e0db34
Test #35
r9-pena Jul 23, 2021
47b5f8e
Test #37
r9-pena Jul 23, 2021
d233deb
Test #38
r9-pena Jul 23, 2021
69341c1
Test #39
r9-pena Jul 23, 2021
68fd4b4
Test #40
r9-pena Jul 23, 2021
b4dda97
Test #41
r9-pena Jul 23, 2021
54699ce
Test #42
r9-pena Jul 23, 2021
d35cc3e
Test #43
r9-pena Jul 23, 2021
a2b0a52
Test #43
r9-pena Jul 23, 2021
f4b2ced
Test #44
r9-pena Jul 23, 2021
5f90df0
Test #45
r9-pena Jul 23, 2021
8f01759
Cleaned up files to remove commented code
r9-pena Jul 23, 2021
fa70aba
Remove CI test branch from workflow
r9-pena Jul 26, 2021
e2fff8a
Merge branch 'nasa:devel' into CI-test
r9-pena Jul 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.git
.github
.dockerignore
**.mdxml
**/docs
**build
4 changes: 1 addition & 3 deletions .github/actions/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ COPY autodoc.bash /autodoc.bash
USER fprime

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh", "$1"]


ENTRYPOINT ["/entrypoint.sh"]
6 changes: 3 additions & 3 deletions .github/actions/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
set -e
set -x
cd "$GITHUB_WORKSPACE"
if [ "$GITHUB_WORKFLOW" == "Autodocs" ]
if "$GITHUB_WORKFLOW" == "Autodocs"
then
/autodoc.bash
else
echo $1
#"$GITHUB_WORKSPACE/ci/master.bash" $1
#echo "$INPUT_TEST1"
"$GITHUB_WORKSPACE/ci/master.bash" $INPUT_TEST
fi
6 changes: 3 additions & 3 deletions .github/actions/github-ci-action.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: 'F prime CI'
description: 'Runs continuous integration testing on F prime'
inputs:
test_type:
test:
description: Test number to run
required: true
default: 1
default: ''
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.test_type }}
- ${{ inputs.test }}
77 changes: 73 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# This workflow contains 4 jobs. One for every CI test."
Framework:
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand All @@ -26,12 +26,81 @@ jobs:
uses: ./.github/actions/
id: github-ci-action
with:
test_type: "QUICK"
test: Framework
# Archive the outputs
- name: 'Archive Logs'
uses: actions/upload-artifact@v2
if: always()
with:
name: ci-logs
name: ci-framework-logs
path: ci-logs.tar.gz
retention-days: 5

Ref:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs the CI action internal to the repository
- name: F prime CI step
uses: ./.github/actions/
id: github-ci-action
with:
test: 'Ref'
# Archive the outputs
- name: 'Archive Logs'
uses: actions/upload-artifact@v2
if: always()
with:
name: ci-ref-logs
path: ci-logs.tar.gz
retention-days: 5

RPI:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs the CI action internal to the repository
- name: F prime CI step
uses: ./.github/actions/
id: github-ci-action
with:
test: 'RPI'
# Archive the outputs
- name: 'Archive Logs'
uses: actions/upload-artifact@v2
if: always()
with:
name: ci-rpi-logs
path: ci-logs.tar.gz
retention-days: 5

Integration:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs the CI action internal to the repository
- name: F prime CI step
uses: ./.github/actions/
id: github-ci-action
with:
test: '30-ints'
# Archive the outputs
- name: 'Archive Logs'
uses: actions/upload-artifact@v2
if: always()
with:
name: ci-int-logs
path: ci-logs.tar.gz
retention-days: 5
2 changes: 1 addition & 1 deletion .github/workflows/tutorial-support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
push:
branches: [ master, devel ]
pull_request:
branches: [ master, devel ]
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://purl.oclc.org/dsdl/schematron">
<pattern id="ASYNC_PORT">
<rule context="component">
<assert test="(//component/@kind = 'active' and (count(//component/ports/port/@kind[. = 'async_input']) + count(//component/internal_interfaces/internal_interface) ) >= 1) or not (//component/@kind = 'active')">
<assert test="(//component/@kind = 'active' and (count(//component/ports/port/@kind[. = 'async_input']) + count(//component/commands/command/@kind[. = 'async']) + count(//component/internal_interfaces/internal_interface) ) >= 1) or not (//component/@kind = 'active')">
Active components should have at least 1 port of kind async_input or internal_interface.
</assert>
</rule>
Expand Down
2 changes: 1 addition & 1 deletion Drv/BlockDriver/BlockDriverComponentAi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
Internal interrupt reporting interface
</comment>
<args>
<arg name="interrupt" type="U32">
<arg name="interrupt_val" type="U32">
<comment>The interrupt register value</comment>
</arg>
</args>
Expand Down
4 changes: 4 additions & 0 deletions Drv/ByteStreamDriverModel/ByteStreamDriverComponentAi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<import_port_type>Drv/ByteStreamDriverModel/ByteStreamSendPortAi.xml</import_port_type>
<import_port_type>Drv/ByteStreamDriverModel/ByteStreamRecvPortAi.xml</import_port_type>
<import_port_type>Drv/ByteStreamDriverModel/ByteStreamPollPortAi.xml</import_port_type>
<import_port_type>Drv/ByteStreamDriverModel/ByteStreamReadyPortAi.xml</import_port_type>
<import_port_type>Fw/Log/LogPortAi.xml</import_port_type>
<import_port_type>Fw/Log/LogTextPortAi.xml</import_port_type>
<import_port_type>Fw/Time/TimePortAi.xml</import_port_type>
Expand All @@ -21,6 +22,9 @@
<port name="poll" data_type="Drv::ByteStreamPoll" kind="guarded_input" max_number="1">
</port>

<port name="ready" data_type="Drv::ByteStreamReady" kind="output" max_number="1">
</port>

<!-- Buffer request port used for incoming data -->
<port name="allocate" data_type="Fw::BufferGet" kind="output" max_number="1">
</port>
Expand Down
4 changes: 4 additions & 0 deletions Drv/ByteStreamDriverModel/ByteStreamReadyPortAi.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>

<interface name="ByteStreamReady" namespace="Drv">
</interface>
1 change: 1 addition & 0 deletions Drv/ByteStreamDriverModel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/ByteStreamRecvPortAi.xml"
"${CMAKE_CURRENT_LIST_DIR}/ByteStreamSendPortAi.xml"
"${CMAKE_CURRENT_LIST_DIR}/ByteStreamPollPortAi.xml"
"${CMAKE_CURRENT_LIST_DIR}/ByteStreamReadyPortAi.xml"
"${CMAKE_CURRENT_LIST_DIR}/ByteStreamDriverComponentAi.xml"
)

Expand Down
16 changes: 11 additions & 5 deletions Drv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxSerialDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxSpiDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxI2cDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ip/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/TcpClient/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/TcpServer/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Udp/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/SocketIpDriver/")

# IP Socket is only supported for Linux, Darwin, VxWorks
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR ${CMAKE_SYSTEM_NAME} STREQUAL "VxWorks")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ip/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/TcpClient/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/TcpServer/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Udp/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/SocketIpDriver/")
else()
message(STATUS "Cannot use IP sockets with platform ${CMAKE_SYSTEM_NAME}. Skipping.")
endif()
8 changes: 5 additions & 3 deletions Drv/Ip/IpSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,22 @@ SocketIpStatus IpSocket::setupTimeouts(NATIVE_INT_TYPE socketFd) {
if (setsockopt(socketFd, SOL_SOCKET, SO_SNDTIMEO, (char*)&timeout, sizeof(timeout)) < 0) {
return SOCK_FAILED_TO_SET_SOCKET_OPTIONS;
}
return SOCK_SUCCESS;
#endif
return SOCK_SUCCESS;
}

SocketIpStatus IpSocket::addressToIp4(const char* address, void* ip4) {
FW_ASSERT(address != NULL);
FW_ASSERT(ip4 != NULL);
// Get the IP address from host
#ifdef TGT_OS_TYPE_VXWORKS
U32 ip = inet_addr(address);
NATIVE_INT_TYPE ip = inet_addr(address);
if (ip == ERROR) {
return SOCK_INVALID_IP_ADDRESS;
}
*ip4 = ip;
// from sin_addr, which has one struct
// member s_addr, which is unsigned int
*reinterpret_cast<unsigned long*>(ip4) = ip;
#else
// First IP address to socket sin_addr
if (not ::inet_pton(AF_INET, address, ip4)) {
Expand Down
1 change: 1 addition & 0 deletions Drv/Ip/IpSocket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ enum SocketIpStatus {
class IpSocket {
public:
IpSocket();
virtual ~IpSocket(){};
/**
* \brief configure the ip socket with host and transmission timeouts
*
Expand Down
9 changes: 7 additions & 2 deletions Drv/Ip/SocketReadTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ void SocketReadTask::startSocketTask(const Fw::StringBase &name,
}

SocketIpStatus SocketReadTask::open() {
return this->getSocketHandler().open();
SocketIpStatus status = this->getSocketHandler().open();
// Call connected any time the open is successful
if (Drv::SOCK_SUCCESS == status) {
this->connected();
}
return status;
}

void SocketReadTask::close() {
Expand All @@ -60,7 +65,7 @@ void SocketReadTask::readTask(void* pointer) {
do {
// Open a network connection if it has not already been open
if ((not self->getSocketHandler().isOpened()) and (not self->m_stop) and
((status = self->getSocketHandler().open()) != SOCK_SUCCESS)) {
((status = self->open()) != SOCK_SUCCESS)) {
Fw::Logger::logMsg("[WARNING] Failed to open port with status %d and errno %d\n", status, errno);
Os::Task::delay(SOCKET_RETRY_INTERVAL_MS);
}
Expand Down
5 changes: 5 additions & 0 deletions Drv/Ip/SocketReadTask.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ class SocketReadTask {
*/
virtual void sendBuffer(Fw::Buffer buffer, SocketIpStatus status) = 0;

/**
* \brief called when the IPv4 system has been connected
*/
virtual void connected() = 0;

/**
* \brief a task designed to read from the socket and output incoming data
*
Expand Down
7 changes: 7 additions & 0 deletions Drv/TcpClient/TcpClientComponentImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ void TcpClientComponentImpl::sendBuffer(Fw::Buffer buffer, SocketIpStatus status
this->recv_out(0, buffer, (status == SOCK_SUCCESS) ? RECV_OK : RECV_ERROR);
}

void TcpClientComponentImpl::connected() {
if (isConnected_ready_OutputPort(0)) {
this->ready_out(0);
}

}

// ----------------------------------------------------------------------
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions Drv/TcpClient/TcpClientComponentImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ class TcpClientComponentImpl : public ByteStreamDriverModelComponentBase, public
*/
void sendBuffer(Fw::Buffer buffer, SocketIpStatus status);

/**
* \brief called when the IPv4 system has been connected
*/
void connected();


PRIVATE:

// ----------------------------------------------------------------------
Expand Down
25 changes: 19 additions & 6 deletions Drv/TcpClient/test/ut/Tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,17 @@ void Tester ::test_with_loop(U32 iterations, bool recv_thread) {
while (not m_spinner) {}
}
}
this->component.close();
// Properly stop the client on the last iteration
if ((1 + i) == iterations && recv_thread) {
this->component.stopSocketTask();
this->component.joinSocketTask(NULL);
} else {
this->component.close();
}
server.close();
}
// Wait for the receiver to shutdown
if (recv_thread) {
this->component.stopSocketTask();
this->component.joinSocketTask(NULL);
}
server.shutdown();
ASSERT_from_ready_SIZE(iterations);
}

Tester ::Tester(void)
Expand Down Expand Up @@ -146,6 +149,10 @@ void Tester ::test_advanced_reconnect(void) {
delete[] recvBuffer.getData();
}

void Tester ::from_ready_handler(const NATIVE_INT_TYPE portNum) {
this->pushFromPortEntry_ready();
}

Fw::Buffer Tester ::
from_allocate_handler(
const NATIVE_INT_TYPE portNum,
Expand Down Expand Up @@ -193,6 +200,12 @@ Fw::Buffer Tester ::
this->get_from_recv(0)
);

// recv
this->component.set_ready_OutputPort(
0,
this->get_from_ready(0)
);

// allocate
this->component.set_allocate_OutputPort(
0,
Expand Down
6 changes: 6 additions & 0 deletions Drv/TcpClient/test/ut/Tester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ namespace Drv {
RecvStatus recvStatus
);

//! Handler for from_ready
//!
void from_ready_handler(
const NATIVE_INT_TYPE portNum /*!< The port number*/
);

//! Handler for from_allocate
//!
Fw::Buffer from_allocate_handler(
Expand Down
7 changes: 7 additions & 0 deletions Drv/TcpServer/TcpServerComponentImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ void TcpServerComponentImpl::sendBuffer(Fw::Buffer buffer, SocketIpStatus status
this->recv_out(0, buffer, (status == SOCK_SUCCESS) ? RECV_OK : RECV_ERROR);
}

void TcpServerComponentImpl::connected() {
if (isConnected_ready_OutputPort(0)) {
this->ready_out(0);
}

}

// ----------------------------------------------------------------------
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------
Expand Down
Loading