Skip to content

Commit 825595e

Browse files
authored
Merge pull request #225 from smartdevicelink/develop
Release 7.1.0
2 parents bb76626 + e923bf1 commit 825595e

File tree

12 files changed

+98
-59
lines changed

12 files changed

+98
-59
lines changed

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ $ git clone https://github.com/smartdevicelink/sdl_atf_test_scripts.git
2929
```
3030

3131
## Compilation
32-
**1.** Install 3d-parties developers libraries
32+
**1.** Install 3rd-parties developers libraries
3333
- Run the following commands:
3434
```
3535
$ sudo apt-get install lua5.2 liblua5.2-dev libxml2-dev lua-lpeg-dev
36-
$ sudo apt-get install openssl libssl1.0-dev
36+
$ sudo apt-get install openssl libssl-dev net-tools
3737
```
3838

3939
**2.** Install Qt5.9+
40-
- For Ubuntu `18.04`:
40+
- For Ubuntu `18.04+`:
4141
- Run the following command:
4242
```
4343
$ sudo apt-get install libqt5websockets5 libqt5websockets5-dev
@@ -83,7 +83,7 @@ $ ln -s ../../sdl_atf_test_scripts/user_modules
8383
**5.** Install dependencies for local parallel mode
8484

8585
Steps below are required only in case if local parallel mode is going to be used.
86-
- Install Docker, e.g. [how-to](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04)
86+
- Install Docker, e.g. [how-to](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04)
8787
- Install additional tools:
8888
```
8989
$ sudo apt-get install screen rsync
@@ -93,8 +93,8 @@ $ sudo apt-get install screen rsync
9393
$ cd atf_parallels/docker
9494
$ ./build.sh <ubuntu_version>
9595
```
96-
<b>Note:</b> accepted values are `16` and `18` (will be processed as `16.04` and `18.04` correspondingly).
97-
If version is not specified `18` will be used by default.
96+
<b>Note:</b> accepted values are `16`, `18`, and `20` (will be processed as `16.04`, `18.04`, and `20.04` correspondingly).
97+
If version is not specified `20` will be used by default.
9898

9999
## Settings
100100

@@ -231,6 +231,7 @@ The best approach is to use predefined configuration (e.g. `remote_linux`) as ba
231231

232232
1. For a big tests sets (>1000 scripts) Report and Logs can be very huge (>10Gb). Most of the space is occupied by SDL logs. In order to turn them off `--sdl-log` or `--sdl-core-dump` options with `no` or `fail` value can be specified.
233233
2. Some scripts (old policy ones) create the same temporary files inside `files`, `test_scripts` or `user_modules` folders. In case of parallel mode the same temporary file can be used by different scripts at the same time. This leads to incorrect results or even aborts. In order to mitigate this issue `--copy-atf-ts` option can be specified. It tells ATF to copy mentioned folders for each job instead of creating symlinks.
234+
3. By default scripts for vehicle data executed for all available parameters. However there is possibility to restrict parameters to be tested by defining `VD_PARAMS` environment variable. E.g. `export VD_PARAMS=gps,speed` will allow to run the tests only for `gps` and `speed` vehicle data parameters.
234235

235236
## Documentation generation
236237

atf_parallels/docker/Dockerfile

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ FROM ubuntu:${ubuntu_ver}
44

55
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
66

7+
ARG openssl_lib_ver
8+
79
RUN apt-get update && apt-get -q -y install \
8-
locales sudo libssl1.0.0 libusb-1.0-0 libbluetooth3 openssl liblua5.2-0 psmisc \
10+
locales sudo libssl${openssl_lib_ver} libssl-dev libusb-1.0-0 libbluetooth3 openssl liblua5.2-0 psmisc \
911
libexpat1 sqlite3 libqt5websockets5 net-tools iproute2 \
10-
libssl-doc- libusb-1.0-doc- autotools-dev- binutils- build-essential- bzip2- cpp- cpp-5- \
12+
libssl-doc- libusb-1.0-doc- autotools-dev- binutils- build-essential- bzip2- cpp- \
1113
dpkg-dev- fakeroot- manpages- manpages-dev- qttranslations5-l10n- xdg-user-dirs- xml-core- dbus-
1214

13-
RUN ln -s /lib/x86_64-linux-gnu/libexpat.so.1.6.7 /usr/lib/x86_64-linux-gnu/libexpat.so
15+
ARG expat_lib_ver
16+
17+
RUN ln -s /lib/x86_64-linux-gnu/libexpat.so.${expat_lib_ver} /usr/lib/x86_64-linux-gnu/libexpat.so
1418

1519
RUN locale-gen en_US.UTF-8 && update-locale LANG=en_US.UTF-8
1620

atf_parallels/docker/build.sh

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/bash
22

33
_ubuntu_ver=$1
4-
_ubuntu_ver_default=18
4+
_ubuntu_ver_default=20
55
_hosted_ubuntu_ver=$(lsb_release -sr 2>/dev/null)
6+
_openssl_lib_ver=1.1
7+
_expat_lib_ver=1.6.11
68

79
function warning {
810
echo "--WARNING!"
@@ -16,8 +18,19 @@ if [ -z $_ubuntu_ver ]; then
1618
fi
1719

1820
case $_ubuntu_ver in
19-
16|18)
21+
16|18|20)
22+
case $_ubuntu_ver in
23+
16)
24+
_openssl_lib_ver=1.0.0
25+
_expat_lib_ver=1.6.0;;
26+
18)
27+
_expat_lib_ver=1.6.7;;
28+
*)
29+
;;
30+
esac
31+
2032
_ubuntu_ver=$_ubuntu_ver.04
33+
2134
if [ ! -z $_hosted_ubuntu_ver ]; then
2235
if [ ! $_hosted_ubuntu_ver = $_ubuntu_ver ]; then
2336
warning "Specified Ubuntu version '$_ubuntu_ver' does not match the hosted Ubuntu version '$_hosted_ubuntu_ver'"
@@ -28,8 +41,8 @@ case $_ubuntu_ver in
2841

2942
echo "Ubuntu version: "$_ubuntu_ver;;
3043
*)
31-
warning "Specified Ubuntu version '$_ubuntu_ver' is unexpected. Allowed versions: 16 or 18";
44+
warning "Specified Ubuntu version '$_ubuntu_ver' is unexpected. Allowed versions: 16, 18, or 20";
3245
exit 1;;
3346
esac
3447

35-
docker build --build-arg ubuntu_ver=$_ubuntu_ver -f Dockerfile -t atf_worker .
48+
docker build --build-arg ubuntu_ver=$_ubuntu_ver --build-arg openssl_lib_ver=$_openssl_lib_ver --build-arg expat_lib_ver=$_expat_lib_ver -f Dockerfile -t atf_worker .

atf_parallels/loop.sh

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function docker_run {
2424
--cap-add NET_ADMIN \
2525
--privileged \
2626
-e LOCAL_USER_ID=`id -u $USER` \
27+
-e VD_PARAMS=$VD_PARAMS \
2728
-v $_atf_ts_dir:/home/developer/atf_ts \
2829
-v $_tmpdirname:/home/developer/sdl \
2930
-v $_sdl_prepared:/home/developer/sdl_ext \

modules/configuration/app_config.lua

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ config.application1 =
1616
syncMsgVersion =
1717
{
1818
majorVersion = 7,
19-
minorVersion = 0
19+
minorVersion = 1
2020
},
2121
appName = "Test Application",
2222
isMediaApplication = true,
@@ -44,7 +44,7 @@ config.application2 =
4444
syncMsgVersion =
4545
{
4646
majorVersion = 7,
47-
minorVersion = 0
47+
minorVersion = 1
4848
},
4949
appName = "Test Application2",
5050
isMediaApplication = true,
@@ -72,7 +72,7 @@ config.application3 =
7272
syncMsgVersion =
7373
{
7474
majorVersion = 7,
75-
minorVersion = 0
75+
minorVersion = 1
7676
},
7777
appName = "Test Application3",
7878
isMediaApplication = true,
@@ -100,7 +100,7 @@ config.application4 =
100100
syncMsgVersion =
101101
{
102102
majorVersion = 7,
103-
minorVersion = 0
103+
minorVersion = 1
104104
},
105105
appName = "Test Application4",
106106
isMediaApplication = true,
@@ -128,7 +128,7 @@ config.application5 =
128128
syncMsgVersion =
129129
{
130130
majorVersion = 7,
131-
minorVersion = 0
131+
minorVersion = 1
132132
},
133133
appName = "Test Application5",
134134
isMediaApplication = true,

src/luaopenssl/lua_openssl.cc

+13-11
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ extern "C" {
1313
#include <openssl/engine.h>
1414
}
1515

16+
#define OPENSSL1_1_VERSION 0x10100000L
17+
1618
/**
1719
* @brief Definition of function pointer type info_callback
1820
* @param OpenSSL SSL
@@ -54,13 +56,8 @@ namespace {
5456
* @brief OpenSSL library cleanup
5557
**/
5658
void cleanupOpensslLib() {
57-
ERR_remove_state(0);
58-
ENGINE_cleanup();
59-
CONF_modules_unload(1);
60-
ERR_free_strings();
6159
EVP_cleanup();
62-
sk_SSL_COMP_free(SSL_COMP_get_compression_methods());
63-
CRYPTO_cleanup_all_ex_data();
60+
ERR_free_strings();
6461
}
6562

6663
/**
@@ -75,13 +72,19 @@ namespace {
7572
method = SSLv23_method();
7673
break;
7774
case SP_TLS:
75+
#if OPENSSL_VERSION_NUMBER < OPENSSL1_1_VERSION
7876
method = TLSv1_2_method();
77+
#else
78+
method = TLS_method();
79+
#endif
7980
break;
81+
#ifndef OPENSSL_NO_SSL3
8082
case SP_SSL:
8183
method = SSLv3_method();
8284
break;
85+
#endif
8386
case SP_DTLS:
84-
method = DTLSv1_method();
87+
method = DTLS_method();
8588
break;
8689
default:
8790
printf("Error: Can not create SSL context with security protocol %d\n", type);
@@ -275,20 +278,19 @@ namespace {
275278
* @return OpenSSL BIO structure
276279
**/
277280
BIO* newBIO(const int type) {
278-
BIO_METHOD* methodType;
281+
BIO* bio = NULL;
279282
switch ((BIOTypes)type) {
280283
case BIO_SOURCE:
281-
methodType = BIO_s_mem();
284+
bio = BIO_new(BIO_s_mem());
282285
break;
283286
case BIO_FILTER:
284-
methodType = BIO_f_ssl();
287+
bio = BIO_new(BIO_f_ssl());
285288
break;
286289
default:
287290
printf("Error: Can not create BIO with type %d\n", type);
288291
return NULL;
289292
}
290293

291-
BIO* bio = BIO_new(methodType);
292294
if (bio && type == BIO_SOURCE) {
293295
BIO_set_mem_eof_return(bio, -1);
294296
}

src/remote_adapter/remote_adapter_server/BOOST.cmake

+10-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ if(QNXNTO)
2424
set(CMAKE_FIND_ROOT_PATH "${CMAKE_FIND_ROOT_PATH}" "${BOOST_ROOT}")
2525
endif()
2626

27-
find_package(Boost 1.68.0 COMPONENTS system filesystem)
27+
find_package(Boost 1.72.0 COMPONENTS system filesystem)
2828

2929
if (NOT ${Boost_FOUND})
30-
message(STATUS "Did not find boost. Downloading and installing boost 1.68")
30+
message(STATUS "Did not find boost. Downloading and installing boost 1.72")
31+
set(BOOST_ROOT ${CMAKE_CURRENT_BINARY_DIR}/third_party/boost)
32+
set(BOOST_INSTALL ${BOOST_ROOT})
33+
set(BOOST_INCLUDE_DIRS ${BOOST_INSTALL}/include)
34+
set(BOOST_LIBRARY_DIRS ${BOOST_INSTALL}/lib)
3135
if(NOT QNXNTO)
3236
set(BOOST_GCC_JAM "")
3337
set(BOOST_FILESYSTEM_OPERATION "")
@@ -59,14 +63,17 @@ if (NOT ${Boost_FOUND})
5963
endif()
6064
set(BOOST_INSTALL_COMMAND ${BOOST_BUILD_COMMAND} install)
6165
ExternalProject_Add(Boost
62-
URL https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz https://newcontinuum.dl.sourceforge.net/project/boost/boost/1.68.0/boost_1_68_0.tar.gz
66+
URL https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.gz https://newcontinuum.dl.sourceforge.net/project/boost/boost/1.72.0/boost_1_72_0.tar.gz
6367
DOWNLOAD_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
6468
SOURCE_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
6569
CONFIGURE_COMMAND ${BOOST_GCC_JAM} COMMAND ${BOOST_FILESYSTEM_OPERATION} COMMAND ${BOOTSTRAP}
6670
BUILD_COMMAND echo ${BOOST_PROJECT_CONFIG_JAM} >> ./project-config.jam COMMAND ${BOOST_BUILD_COMMAND}
6771
INSTALL_COMMAND ${BOOST_INSTALL_COMMAND}
6872
INSTALL_DIR ${BOOST_INSTALL}
6973
BUILD_IN_SOURCE true)
74+
else()
75+
set(BOOST_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
76+
set(BOOST_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
7077
endif()
7178

7279
set(BOOST_LIBRARIES

src/remote_adapter/remote_adapter_server/plugins/transport/message_broker.cpp

+5-9
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void Fail(boost::system::error_code ec, char const *what) {
7878

7979
// //------------------------------------------------------------------------------
8080
WebsocketSession::WebsocketSession(tcp::socket socket)
81-
: ws_(std::move(socket)), strand_(ws_.get_executor()) {
81+
: ws_(std::move(socket)) {
8282
LOG_INFO("{0}", __func__);
8383
}
8484

@@ -100,9 +100,8 @@ void WebsocketSession::AsyncRead() {
100100

101101
ws_.async_read(
102102
read_buffer_,
103-
boost::asio::bind_executor(
104-
strand_, std::bind(&WebsocketSession::OnRead, shared_from_this(),
105-
std::placeholders::_1, std::placeholders::_2)));
103+
std::bind(&WebsocketSession::OnRead, shared_from_this(),
104+
std::placeholders::_1, std::placeholders::_2));
106105
}
107106

108107
void WebsocketSession::OnRead(boost::system::error_code ec,
@@ -199,7 +198,7 @@ template <class Session> void WebsocketListener<Session>::Run() {
199198

200199
template <class Session> void WebsocketListener<Session>::Stop() {
201200
LOG_INFO("{0}", __func__);
202-
resolver_.get_io_context().stop();
201+
resolver_.cancel();
203202
if (session_.use_count()) {
204203
session_->Close();
205204
}
@@ -229,9 +228,6 @@ void WebsocketListener<Session>::OnResolve(
229228
if (er) {
230229
Fail(er, "WebsocketListener::OnResolve connect");
231230
resolver_.cancel();
232-
if (resolver_.get_io_context().stopped()) {
233-
return;
234-
}
235231
return DoResolve();
236232
}
237233

@@ -570,7 +566,7 @@ MessageBroker<TCPListener>::MakeEndpoint(const std::string &address,
570566

571567
auto const ip_address = boost::asio::ip::make_address(address.c_str());
572568

573-
return tcp::endpoint{ip_address, port};
569+
return tcp::endpoint{ip_address, static_cast<unsigned short>(port)};
574570
}
575571

576572
#define LIBRARY_API extern "C"

src/remote_adapter/remote_adapter_server/plugins/transport/message_broker.h

-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "rpc/detail/log.h"
55
#include <boost/asio/bind_executor.hpp>
66
#include <boost/asio/ip/tcp.hpp>
7-
#include <boost/asio/strand.hpp>
87
#include <boost/beast/core.hpp>
98
#include <boost/beast/websocket.hpp>
109
#include <future>
@@ -126,7 +125,6 @@ class WebsocketSession : public std::enable_shared_from_this<WebsocketSession> {
126125
void OnClose(boost::system::error_code ec);
127126

128127
websocket::stream<tcp::socket> ws_;
129-
boost::asio::strand<boost::asio::io_context::executor_type> strand_;
130128
boost::beast::multi_buffer read_buffer_;
131129
std::queue<std::string> msg_queue_;
132130
std::mutex msg_queue_lock_;

start.sh

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ P="\033[0;32m" # GREEN
2121
F="\033[0;31m" # RED
2222
A="\033[0;35m" # MAGENTA
2323
S="\033[0;33m" # YELLOW
24+
B="\033[0;34m" # BLUE
2425
N="\033[0m" # NONE
2526

2627
dbg() {

0 commit comments

Comments
 (0)