Skip to content

secure-tunnel-v3-tests #561

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

Merged
merged 38 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
eec7341
linux-integration-tests.yml
sbSteveK Apr 7, 2023
51f9eb4
yml update
sbSteveK Apr 7, 2023
ff6e2bc
run setup-linux.sh
sbSteveK Apr 7, 2023
d780a0f
install cmake
sbSteveK Apr 7, 2023
270d94c
notes
sbSteveK Apr 7, 2023
b30a7bc
test
sbSteveK Apr 7, 2023
ab108c9
test
sbSteveK Apr 7, 2023
67a0018
integration-tests.sh
sbSteveK Apr 7, 2023
508a734
chmod integration-tests.sh
sbSteveK Apr 10, 2023
7f34428
check what's set
sbSteveK Apr 10, 2023
66241be
secure tunneling tests directory
sbSteveK Apr 10, 2023
138e262
print first
sbSteveK Apr 10, 2023
686f20f
open secure tunnel
sbSteveK Apr 10, 2023
6552a2a
open and store tunnel tokens
sbSteveK Apr 10, 2023
cdedf37
work on integration test
sbSteveK Apr 10, 2023
5ef64ad
update
sbSteveK Apr 10, 2023
598e1d1
wip
sbSteveK Apr 11, 2023
40a17a3
remove sleep
sbSteveK Apr 11, 2023
4345125
testing
sbSteveK Apr 11, 2023
73d76cf
test
sbSteveK Apr 11, 2023
c63a9b5
test
sbSteveK Apr 11, 2023
f699b7c
setup fix
sbSteveK Apr 11, 2023
3eb3ed4
test fix
sbSteveK Apr 11, 2023
926c99f
sleep test
sbSteveK Apr 11, 2023
46ac3f6
fix sleep
sbSteveK Apr 11, 2023
ad9e097
separate destination secure tunnel
sbSteveK Apr 11, 2023
6c0a651
start/stop
sbSteveK Apr 11, 2023
294f465
fix
sbSteveK Apr 11, 2023
7f3075b
two clients
sbSteveK Apr 11, 2023
4366853
fix
sbSteveK Apr 11, 2023
f604a47
more testing
sbSteveK Apr 11, 2023
7162fb8
logging
sbSteveK Apr 11, 2023
a6a96fd
segfault check
sbSteveK Apr 11, 2023
96aa7cc
updates
sbSteveK Apr 12, 2023
584eecf
fixed segfault
sbSteveK Apr 12, 2023
31873c5
message sending checks
sbSteveK Apr 12, 2023
d043cdd
comments
sbSteveK Apr 12, 2023
e5ba5a9
clean up service id storage on error
sbSteveK Apr 12, 2023
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
19 changes: 19 additions & 0 deletions codebuild/integration-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
set -e

env

pushd $CODEBUILD_SRC_DIR/secure_tunneling/tests

mkdir _build
cd _build
cmake -DCMAKE_PREFIX_PATH=/tmp/install ..
make -j

tunnel_info=$(aws iotsecuretunneling open-tunnel --destination-config services=ssh,ssh2,ssh3 --timeout-config maxLifetimeTimeoutMinutes=10) && echo -e "$tunnel_info" > /tmp/tunnel_info.pem

export SECTUN_SOURCE_TOKEN=$(sed '4!d' /tmp/tunnel_info.pem | cut -d'"' -f4)
export SECTUN_DESTINATION_TOKEN=$(sed '5!d' /tmp/tunnel_info.pem | cut -d'"' -f4)
export SECTUN_ENDPOINT="data.tunneling.iot.us-east-1.amazonaws.com"

echo "Running Secure Tunnel Test"
./secure_tunnel_test
25 changes: 25 additions & 0 deletions codebuild/linux-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 0.2
env:
shell: bash
#this buildspec assumes the ubuntu 14 image
phases:
install:
commands:
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
- add-apt-repository ppa:ubuntu-toolchain-r/test
- apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main"
- apt-get update -y
- apt-get install cmake -y -f

build:
commands:
- echo Build started on `date`
# Building of dependencies happens in setup-linux
- $CODEBUILD_SRC_DIR/codebuild/samples/setup-linux.sh

# Run the integration tests
- $CODEBUILD_SRC_DIR/codebuild/integration-tests.sh
post_build:
commands:
- echo Build completed on `date`

2 changes: 1 addition & 1 deletion samples/secure_tunneling/secure_tunnel/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ int main(int argc, char *argv[])
/* Set the Secure Tunnel Client to desire a stopped state */
if (secureTunnel->Stop() == AWS_OP_ERR)
{
fprintf(stderr, "Secure Tunnel Close call failed: %s\n", ErrorDebugString(LastError()));
fprintf(stderr, "Secure Tunnel Stop call failed: %s\n", ErrorDebugString(LastError()));
exit(-1);
}

Expand Down
1 change: 0 additions & 1 deletion secure_tunneling/source/SecureTunnel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ namespace Aws
Crt::Allocator *allocator) noexcept
: m_allocator(allocator)
{
aws_byte_buf_clean_up(&m_messageTypeStorage);
AWS_ZERO_STRUCT(m_messageTypeStorage);
struct aws_byte_buf typeBuf = aws_byte_buf_from_c_str(aws_secure_tunnel_message_type_to_c_string(type));

Expand Down
29 changes: 29 additions & 0 deletions secure_tunneling/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.1)
# note: cxx-17 requires cmake 3.8, cxx-20 requires cmake 3.12
project(secure_tunnel_test CXX)

file(GLOB SRC_FILES
"*.cpp"
# "../../utils/CommandLineUtils.cpp"
# "../../utils/CommandLineUtils.h"
)

add_executable(${PROJECT_NAME} ${SRC_FILES})

set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 14)

#set warnings
if (MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX)
else ()
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wno-long-long -pedantic -Werror)
endif ()

find_package(aws-crt-cpp REQUIRED)
find_package(IotDeviceCommon-cpp REQUIRED)
find_package(IotSecureTunneling-cpp REQUIRED)

install(TARGETS ${PROJECT_NAME} DESTINATION bin)

target_link_libraries(${PROJECT_NAME} AWS::aws-crt-cpp AWS::IotDeviceCommon-cpp AWS::IotSecureTunneling-cpp)
Loading