Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1177 from advancedtelematic/refact/OTA-2292/IpUpt…
Browse files Browse the repository at this point in the history
…ane-and-OPCUA-secondaries

OTA-2480: Remove OPC-UA and move IpUptaneSecondary out of libaktualizr
  • Loading branch information
pattivacek authored Apr 11, 2019
2 parents e4548ea + dbae2e1 commit abe9373
Show file tree
Hide file tree
Showing 101 changed files with 95 additions and 54,890 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
- DOCKERFILE=docker/Dockerfile.ubuntu.bionic SCRIPT=scripts/test.sh
DARGS="-eTEST_CMAKE_BUILD_TYPE=Valgrind -eTEST_WITH_COVERAGE=1 -eTEST_WITH_P11=1 -eTEST_WITH_FAULT_INJECTION=1 -eTEST_TESTSUITE_EXCLUDE=credentials -eTEST_SOTA_PACKED_CREDENTIALS=dummy-credentials"
- DOCKERFILE=docker/Dockerfile.debian.testing SCRIPT=scripts/test.sh
DARGS="-eTEST_CC=clang -eTEST_WITH_LOAD_TESTS=1 -eTEST_WITH_TESTSUITE=0 -eTEST_WITH_STATICTESTS=1 -eTEST_WITH_OPCUA=1"
DARGS="-eTEST_CC=clang -eTEST_WITH_LOAD_TESTS=1 -eTEST_WITH_TESTSUITE=0 -eTEST_WITH_STATICTESTS=1"
- DEPLOY_PKGS=1 RELEASE_NAME=ubuntu_18.04 DOCKERFILE=docker/Dockerfile.ubuntu.bionic INSTALL_DOCKERFILE=docker/Dockerfile-test-install.ubuntu.bionic SCRIPT=scripts/build_ubuntu.sh DARGS="-eTEST_INSTALL_RELEASE_NAME=-ubuntu_18.04"
- DEPLOY_PKGS=1 RELEASE_NAME=ubuntu_16.04 DOCKERFILE=docker/Dockerfile.ubuntu.xenial INSTALL_DOCKERFILE=docker/Dockerfile-test-install.ubuntu.xenial SCRIPT=scripts/build_ubuntu.sh DARGS="-eTEST_INSTALL_RELEASE_NAME=-ubuntu_16.04"
services:
Expand Down
20 changes: 1 addition & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ option(BUILD_OSTREE "Set to ON to compile with ostree support" OFF)
option(BUILD_DEB "Set to ON to compile with debian packages support" OFF)
option(BUILD_P11 "Support for key storage in a HSM via PKCS#11" OFF)
option(BUILD_SOTA_TOOLS "Set to ON to build SOTA tools" OFF)
option(BUILD_OPCUA "Set to ON to compile with OPC-UA protocol support" OFF)
option(BUILD_PARTIAL "Set to ON to compile with partial secondaries support" OFF)
option(BUILD_ISOTP "Set to ON to compile with ISO/TP protocol support" OFF)
option(BUILD_SYSTEMD "Set to ON to compile with systemd additional support" ${BUILD_SYSTEMD_DEFAULT})
Expand Down Expand Up @@ -59,7 +58,7 @@ unset(AKTUALIZR_CHECKED_SRCS CACHE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# find all required libraries
set(BOOST_COMPONENTS log_setup log filesystem program_options)
set(BOOST_COMPONENTS log_setup log system filesystem program_options)
set(Boost_USE_STATIC_LIBS OFF)
add_definitions(-DBOOST_LOG_DYN_LINK)

Expand All @@ -72,10 +71,6 @@ if(ANDROID)
endif()
endif(ANDROID)

if(BUILD_OPCUA)
list(APPEND BOOST_COMPONENTS serialization iostreams)
endif(BUILD_OPCUA)

# Mac brew library install paths

if(EXISTS /usr/local/opt/openssl)
Expand Down Expand Up @@ -143,13 +138,6 @@ if(BUILD_SOTA_TOOLS)
find_program(STRACE NAMES strace)
endif(BUILD_SOTA_TOOLS)

if(BUILD_OPCUA)
add_definitions(-DOPCUA_SECONDARY_ENABLED)
if (NOT BUILD_OSTREE)
message(FATAL_ERROR "BUILD_OPCUA requires BUILD_OSTREE")
endif(NOT BUILD_OSTREE)
endif(BUILD_OPCUA)

if(BUILD_ISOTP)
add_definitions(-DISOTP_SECONDARY_ENABLED)
endif(BUILD_ISOTP)
Expand Down Expand Up @@ -435,12 +423,6 @@ add_subdirectory("docs")
file(GLOB_RECURSE ALL_SOURCE_FILES RELATIVE ${CMAKE_SOURCE_DIR}
src/*.cc src/*.c src/*.h)
foreach(FILE ${ALL_SOURCE_FILES})
# ignore opcuabridge
string (FIND ${FILE} "/opcuabridge/" EXCLUDE_DIR_FOUND)
if (NOT ${EXCLUDE_DIR_FOUND} EQUAL -1)
continue()
endif()

string (FIND ${FILE} "/isotp_conn/" EXCLUDE_DIR_FOUND)
if (NOT ${EXCLUDE_DIR_FOUND} EQUAL -1)
continue()
Expand Down
1 change: 0 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ pipeline {
TEST_CMAKE_BUILD_TYPE = 'Debug'
TEST_TESTSUITE_ONLY = 'crypto'
TEST_WITH_STATICTESTS = '1'
TEST_WITH_OPCUA = '1'
TEST_WITH_LOAD_TESTS = '1' // build only
}
steps {
Expand Down
1 change: 0 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Some features also require additional packages:
* For PKCS#11 support, you will need `libp11-2 libp11-dev`.
* For systemd support for secondaries, you will need `libsystemd-dev`.
* For fault injection, you will need `fiu-utils libfiu-dev`.
* For OPCUA support, you will need `libboost-iostreams-dev libboost-serialization-dev`.
* For Debian packagin support, you will need `libdpkg-dev`.

==== Mac support
Expand Down
1 change: 0 additions & 1 deletion actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ These are internal requirements that are relatively opaque to the user and/or co
- [x] Support virtual partial verification secondaries for testing
- [x] Partial verification secondaries generate and store public keys (uptane_secondary_test.cc)
- [x] Partial verification secondaries can verify Uptane metadata (uptane_secondary_test.cc)
- [x] Support OPC-UA secondaries (opcuabridge_messaging_test.cc, opcuabridge_secondary_update_test.cc, run_opcuabridge_ostree_repo_sync_test.sh)

### Expected action sequences

Expand Down
1 change: 0 additions & 1 deletion ci/gitlab/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ Debian build and test:
TEST_CMAKE_BUILD_TYPE: 'Debug'
TEST_TESTSUITE_ONLY: 'crypto'
TEST_WITH_STATICTESTS: '1'
TEST_WITH_OPCUA: '1'
TEST_WITH_LOAD_TESTS: '1'
image: "$DEBIAN_TESTING_PR_IMAGE"
stage: Build and Test
Expand Down
1 change: 0 additions & 1 deletion docker/Dockerfile-test-install.ubuntu.bionic
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get -y install debian-archive-keyring
RUN apt-get update && apt-get install -y \
libarchive13 \
libboost-iostreams1.65.1 \
libboost-log1.65.1 \
libboost-program-options1.65.1 \
libboost-system1.65.1 \
Expand Down
1 change: 0 additions & 1 deletion docker/Dockerfile-test-install.ubuntu.xenial
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get -y install debian-archive-keyring
RUN apt-get update && apt-get install -y \
libarchive13 \
libboost-iostreams1.58.0 \
libboost-log1.58.0 \
libboost-program-options1.58.0 \
libboost-system1.58.0 \
Expand Down
1 change: 0 additions & 1 deletion docker/Dockerfile.debian.testing
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ RUN apt-get update && apt-get -y install \
lcov \
libarchive-dev \
libboost-dev \
libboost-iostreams-dev \
libboost-log-dev \
libboost-program-options-dev \
libboost-system-dev \
Expand Down
1 change: 0 additions & 1 deletion docker/Dockerfile.ubuntu.bionic
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ RUN apt-get update && apt-get -y install \
lcov \
libarchive-dev \
libboost-dev \
libboost-iostreams-dev \
libboost-log-dev \
libboost-program-options-dev \
libboost-system-dev \
Expand Down
1 change: 0 additions & 1 deletion docker/Dockerfile.ubuntu.xenial
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ RUN apt-get update && apt-get -y install \
lcov \
libarchive-dev \
libboost-dev \
libboost-iostreams-dev \
libboost-log-dev \
libboost-program-options-dev \
libboost-system-dev \
Expand Down
1 change: 0 additions & 1 deletion docs/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,6 @@ INPUT = @CMAKE_SOURCE_DIR@/CONTRIBUTING.md \
@CMAKE_SOURCE_DIR@/src/libaktualizr/crypto \
@CMAKE_SOURCE_DIR@/src/libaktualizr/http \
@CMAKE_SOURCE_DIR@/src/libaktualizr/logging \
@CMAKE_SOURCE_DIR@/src/libaktualizr/opcuabridge \
@CMAKE_SOURCE_DIR@/src/libaktualizr/package_manager \
@CMAKE_SOURCE_DIR@/src/libaktualizr/primary \
@CMAKE_SOURCE_DIR@/src/libaktualizr/socket_activation \
Expand Down
2 changes: 0 additions & 2 deletions docs/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ link:./integrating-libaktualizr.adoc[integrating-libaktualizr.adoc] - How to use

link:./linux-secondaries.adoc[linux-secondaries.adoc] - A quick how-to demonstrating aktualizr on a secondary ECU, using two QEMU devices.

link:./opcua-bridge.adoc[opcua-bridge.adoc] - Some basic documentation on getting OPC-UA working. OPC-UA is a protocol for in-vehicle inter-ECU communication.

link:./rollback.adoc[rollback.adoc] - Developer documentation on how aktualizr, OSTree, and u-boot can be used to implement automatic rollback of a failed update.

link:./schema-migrations.adoc[schema-migrations.adoc] - aktualizr uses a SQLite database for storing some config information and keys. This describes the steps needed for migrating the DB schema. Only useful for aktualizr developers.
Expand Down
44 changes: 0 additions & 44 deletions docs/opcua-bridge.adoc

This file was deleted.

2 changes: 0 additions & 2 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ TEST_WITH_OSTREE=${TEST_WITH_OSTREE:-1}
TEST_WITH_DEB=${TEST_WITH_DEB:-1}
TEST_WITH_ISOTP=${TEST_WITH_ISOTP:-1}
TEST_WITH_PARTIAL=${TEST_WITH_PARTIAL:-1}
TEST_WITH_OPCUA=${TEST_WITH_OPCUA:-0}
TEST_WITH_FAULT_INJECTION=${TEST_WITH_FAULT_INJECTION:-0}
TEST_WITH_LOAD_TESTS=${TEST_WITH_LOAD_TESTS:-0}

Expand Down Expand Up @@ -51,7 +50,6 @@ if [[ $TEST_WITH_OSTREE = 1 ]]; then CMAKE_ARGS+=("-DBUILD_OSTREE=ON"); fi
if [[ $TEST_WITH_DEB = 1 ]]; then CMAKE_ARGS+=("-DBUILD_DEB=ON"); fi
if [[ $TEST_WITH_ISOTP = 1 ]]; then CMAKE_ARGS+=("-DBUILD_ISOTP=ON"); fi
if [[ $TEST_WITH_PARTIAL = 1 ]]; then CMAKE_ARGS+=("-DBUILD_PARTIAL=ON"); fi
if [[ $TEST_WITH_OPCUA = 1 ]]; then CMAKE_ARGS+=("-DBUILD_OPCUA=ON"); fi
if [[ $TEST_WITH_FAULT_INJECTION = 1 ]]; then CMAKE_ARGS+=("-DFAULT_INJECTION=ON"); fi
if [[ $TEST_WITH_LOAD_TESTS = 1 ]]; then CMAKE_ARGS+=("-DBUILD_LOAD_TESTS=ON"); fi
if [[ -n $TEST_SOTA_PACKED_CREDENTIALS ]]; then
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ endif()
add_subdirectory("libaktualizr")
add_subdirectory("sota_tools")
add_subdirectory("aktualizr_primary")
add_subdirectory("libaktualizr-posix")
add_subdirectory("aktualizr_secondary")
add_subdirectory("aktualizr_info")
add_subdirectory("aktualizr_repo")
Expand Down
4 changes: 3 additions & 1 deletion src/aktualizr_check_discovery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
set(AKTUALIZR_CHECK_DISCOVERY_SRC main.cc )

add_executable(aktualizr-check-discovery ${AKTUALIZR_CHECK_DISCOVERY_SRC})
target_link_libraries(aktualizr-check-discovery aktualizr_static_lib ${AKTUALIZR_EXTERNAL_LIBS})
target_link_libraries(aktualizr-check-discovery aktualizr-posix ${AKTUALIZR_EXTERNAL_LIBS})

install(TARGETS aktualizr-check-discovery
COMPONENT aktualizr
RUNTIME DESTINATION bin)

target_include_directories(aktualizr-check-discovery PUBLIC ${PROJECT_SOURCE_DIR}/src/libaktualizr-posix)

aktualizr_source_file_checks(${AKTUALIZR_CHECK_DISCOVERY_SRC})

# vim: set tabstop=4 shiftwidth=4 expandtab:
2 changes: 1 addition & 1 deletion src/aktualizr_check_discovery/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include "uptane/secondaryfactory.h"
#include "uptane/secondaryinterface.h"

#include "ipsecondarydiscovery.h"
#include "logging/logging.h"
#include "uptane/ipsecondarydiscovery.h"

namespace po = boost::program_options;

Expand Down
23 changes: 4 additions & 19 deletions src/aktualizr_secondary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ set(AKTUALIZR_SECONDARY_LIB_SRC

add_library(aktualizr_secondary_static_lib STATIC
${AKTUALIZR_SECONDARY_LIB_SRC}
$<TARGET_OBJECTS:asn1>
$<TARGET_OBJECTS:asn1_lib>
$<TARGET_OBJECTS:bootloader>
$<TARGET_OBJECTS:crypto>
$<TARGET_OBJECTS:jsoncpp>
Expand All @@ -22,23 +20,12 @@ add_library(aktualizr_secondary_static_lib STATIC
$<TARGET_OBJECTS:uptane>
$<TARGET_OBJECTS:socket_activation>)

set(OPCUA_SECONDARY_SRC
opcuaserver_secondary_delegate.cc
aktualizr_secondary_opcua.cc
)

if (BUILD_OPCUA)
target_sources(aktualizr_secondary_static_lib PRIVATE
${OPCUA_SECONDARY_SRC} $<TARGET_OBJECTS:opcua_bridge>)
set_source_files_properties(${OPCUA_SECONDARY_SRC} ${AKTUALIZR_SECONDARY_SRC}
PROPERTIES COMPILE_FLAGS "-Wno-unused-parameter -Wno-float-equal -Wno-logical-op -Wno-unknown-warning-option")
target_include_directories(aktualizr_secondary_static_lib PUBLIC ${PROJECT_SOURCE_DIR}/src/libaktualizr/opcuabridge
${PROJECT_SOURCE_DIR}/third_party/open62541)
endif (BUILD_OPCUA)
target_link_libraries(aktualizr_secondary_static_lib aktualizr-posix)

target_include_directories(aktualizr_secondary_static_lib PUBLIC
$<TARGET_PROPERTY:socket_activation,INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:asn1_lib,INCLUDE_DIRECTORIES>
${PROJECT_SOURCE_DIR}/src/libaktualizr-posix
)

add_executable(aktualizr-secondary ${AKTUALIZR_SECONDARY_SRC})
Expand All @@ -57,8 +44,6 @@ set(ALL_AKTUALIZR_SECONDARY_HEADERS
aktualizr_secondary_config.h
aktualizr_secondary_common.h
aktualizr_secondary_discovery.h
aktualizr_secondary_opcua.h
opcuaserver_secondary_delegate.h
socket_server.h
)

Expand All @@ -81,6 +66,7 @@ if(BUILD_OSTREE)

add_aktualizr_test(NAME aktualizr_secondary_uptane
SOURCES uptane_test.cc
LIBRARIES aktualizr-posix
ARGS ${PROJECT_BINARY_DIR}/ostree_repo PROJECT_WORKING_DIRECTORY)
else(BUILD_OSTREE)
list(APPEND TEST_SOURCES aktualizr_secondary_discovery_test.cc uptane_test.cc)
Expand Down Expand Up @@ -152,8 +138,7 @@ set_tests_properties(aktualizr_secondary_help_with_other_options

aktualizr_source_file_checks(${AKTUALIZR_SECONDARY_SRC}
${AKTUALIZR_SECONDARY_LIB_SRC}
${ALL_AKTUALIZR_SECONDARY_HEADERS}
${OPCUA_SECONDARY_SRC}
${ALL_AKTUALIZR_SECONDARY_HEADERS}
${TEST_SOURCES})

# vim: set tabstop=4 shiftwidth=4 expandtab:
2 changes: 1 addition & 1 deletion src/aktualizr_secondary/aktualizr_secondary_discovery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#include <sys/types.h>

#include "asn1/asn1-cerstream.h"
#include "ipsecondarydiscovery.h"
#include "logging/logging.h"
#include "socket_activation/socket_activation.h"
#include "uptane/ipsecondarydiscovery.h"
#include "utilities/sockaddr_io.h"
#include "utilities/utils.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "aktualizr_secondary_discovery.h"
#include "config/config.h"
#include "uptane/ipsecondarydiscovery.h" // to test from the other side
#include "ipsecondarydiscovery.h" // to test from the other side

#include "logging/logging.h"

Expand Down
20 changes: 0 additions & 20 deletions src/aktualizr_secondary/aktualizr_secondary_opcua.cc

This file was deleted.

27 changes: 0 additions & 27 deletions src/aktualizr_secondary/aktualizr_secondary_opcua.h

This file was deleted.

Loading

0 comments on commit abe9373

Please sign in to comment.