diff options
26 files changed, 260 insertions, 302 deletions
diff --git a/.github/workflows/sdl_core_github_ci.yml b/.github/workflows/sdl_core_github_ci.yml index 14ff51c2fe..47e13f9673 100644 --- a/.github/workflows/sdl_core_github_ci.yml +++ b/.github/workflows/sdl_core_github_ci.yml @@ -9,7 +9,7 @@ jobs: run: git -C ${{ github.workspace }} submodule update --init --recursive # Install Dependencies - name: Apt Get Dependencies - run: sudo apt-get update && sudo apt-get install libssl-dev libbluetooth3 libbluetooth-dev libudev-dev cmake html2text lcov git cmake automake1.11 build-essential libavahi-client-dev sqlite3 libsqlite3-dev libgtest-dev bluez-tools libpulse-dev libusb-1.0.0-dev cppcheck python3-pip python3-setuptools && sudo apt-get install -f clang-format-8 + run: sudo apt-get update && sudo apt-get install libssl-dev libbluetooth3 libbluetooth-dev libudev-dev cmake html2text lcov git cmake automake1.11 build-essential libavahi-client-dev sqlite3 libsqlite3-dev libgtest-dev bluez-tools libpulse-dev libusb-1.0.0-dev cppcheck python3-pip python3-setuptools python3-wheel && sudo apt-get install -f clang-format-8 - name: Setup CMAKE uses: jwlawson/actions-setup-cmake@v1.8 with: @@ -36,7 +36,7 @@ jobs: - name: Configure run: cmake ../sdl_core -DBUILD_TESTS=ON -DLOGGER_NAME=BOOST - name: Build - run: make install-3rd_party && make -j `nproc` install + run: make install-3rd_party && make install_python_dependencies && make -j `nproc` install - name: Set Library Path run: echo "LD_LIBRARY_PATH=$THIRD_PARTY_INSTALL_PREFIX/lib:." >> $GITHUB_ENV # run tests diff --git a/.github/workflows/sdl_core_github_ci_coverity.yml b/.github/workflows/sdl_core_github_ci_coverity.yml index c60482d30f..c3cbec5893 100644 --- a/.github/workflows/sdl_core_github_ci_coverity.yml +++ b/.github/workflows/sdl_core_github_ci_coverity.yml @@ -21,7 +21,7 @@ jobs: run: git -C ${{ github.workspace }} submodule update --init --recursive # Install Dependencies - name: Apt Get Dependencies - run: sudo apt-get update && sudo apt-get install libssl-dev libbluetooth3 libbluetooth-dev libudev-dev cmake html2text lcov git cmake automake1.11 build-essential libavahi-client-dev sqlite3 libsqlite3-dev libgtest-dev bluez-tools libpulse-dev libusb-1.0.0-dev cppcheck python3-pip python3-setuptools && sudo apt-get install -f clang-format-6.0 + run: sudo apt-get update && sudo apt-get install libssl-dev libbluetooth3 libbluetooth-dev libudev-dev cmake html2text lcov git cmake automake1.11 build-essential libavahi-client-dev sqlite3 libsqlite3-dev libgtest-dev bluez-tools libpulse-dev libusb-1.0.0-dev cppcheck python3-pip python3-setuptools python3-wheel && sudo apt-get install -f clang-format-8 - name: Setup CMAKE uses: jwlawson/actions-setup-cmake@v1.8 with: @@ -51,7 +51,7 @@ jobs: - name: unzip run: tar zxvf coverity_tool.tgz - name: Build - run: make install-3rd_party && ./cov-analysis-linux64-2020.09/bin/cov-build --dir cov-int make -j `nproc` install + run: make install-3rd_party && make install_python_dependencies && ./cov-analysis-linux64-2020.09/bin/cov-build --dir cov-int make -j `nproc` install - name: Set Library Path run: echo "LD_LIBRARY_PATH=$THIRD_PARTY_INSTALL_PREFIX/lib:." >> $GITHUB_ENV - name: Compress Coverity diff --git a/src/appMain/life_cycle_impl.cc b/src/appMain/life_cycle_impl.cc index 8b67877ac8..762f506814 100644 --- a/src/appMain/life_cycle_impl.cc +++ b/src/appMain/life_cycle_impl.cc @@ -237,12 +237,14 @@ void sig_handler(int sig) { SDL_LOG_DEBUG("SIGTERM signal has been caught"); break; case SIGSEGV: + std::cerr << "SIGSEGV caught" << std::endl; SDL_LOG_DEBUG("SIGSEGV signal has been caught"); SDL_FLUSH_LOGGER(); // exit need to prevent endless sending SIGSEGV // http://stackoverflow.com/questions/2663456/how-to-write-a-signal-handler-to-catch-sigsegv abort(); default: + std::cerr << "Unexpected signal " << sig << " caught" << std::endl; SDL_LOG_DEBUG("Unexpected signal has been caught"); exit(EXIT_FAILURE); } diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index c8c2a25a6d..500981a5a8 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -720,7 +720,7 @@ void PolicyHandler::OnAppPermissionConsentInternal( policy_manager->SetUserConsentForApp(out_permissions); #endif } - } else if (!app_to_device_link_.empty()) { + } else { const ApplicationSet& accessor = application_manager_.applications().GetData(); for (const auto& app : accessor) { @@ -759,10 +759,6 @@ void PolicyHandler::OnAppPermissionConsentInternal( policy_manager->SetUserConsentForApp(out_permissions); #endif } - } else { - SDL_LOG_WARN( - "There are no applications previously stored for " - "setting common permissions."); } #ifdef EXTERNAL_PROPRIETARY_MODE if (!policy_manager->SetExternalConsentStatus(external_consent_status)) { @@ -2873,6 +2869,10 @@ void PolicyHandler::UpdateHMILevel(ApplicationSharedPtr app, bool PolicyHandler::CheckModule(const PTString& app_id, const PTString& module) { + if (!PolicyEnabled()) { + SDL_LOG_DEBUG("Policy table is disabled"); + return true; + } const auto policy_manager = LoadPolicyManager(); POLICY_LIB_CHECK_OR_RETURN(policy_manager, false); return policy_manager->CheckModule(app_id, module); @@ -2943,6 +2943,10 @@ bool PolicyHandler::CheckHMIType(const std::string& application_id, mobile_apis::AppHMIType::eType hmi, const smart_objects::SmartObject* app_types) { SDL_LOG_AUTO_TRACE(); + if (!PolicyEnabled()) { + SDL_LOG_DEBUG("Policy table is disabled"); + return true; + } const auto policy_manager = LoadPolicyManager(); POLICY_LIB_CHECK_OR_RETURN(policy_manager, false); std::vector<int> policy_hmi_types; diff --git a/src/components/application_manager/test/sdl_pt_update.json b/src/components/application_manager/test/sdl_pt_update.json index bb69933497..e3c9c15861 100644 --- a/src/components/application_manager/test/sdl_pt_update.json +++ b/src/components/application_manager/test/sdl_pt_update.json @@ -16,7 +16,6 @@ "Emergency-1" ], "keep_context" : true, - "memory_kb" : 1000, "nicknames" : [ "SyncProxyTester" ], "priority" : "EMERGENCY", "steal_focus" : true, @@ -32,7 +31,6 @@ "default_hmi" : "NONE", "groups" : [ "Base-4" ], "keep_context" : false, - "memory_kb" : 1000, "priority" : "NONE", "steal_focus" : false, "watchdog_timer_ms" : 20000 @@ -40,7 +38,6 @@ "device" : { "default_hmi" : "NONE", "groups" : [ "Base-4" ], - "memory_kb" : 1000, "watchdog_timer_ms" : 20000, "keep_context" : false, "priority" : "NONE", @@ -50,7 +47,6 @@ "default_hmi" : "NONE", "groups" : [ "pre_Base-1" ], "keep_context" : false, - "memory_kb" : 1000, "priority" : "NONE", "steal_focus" : false, "watchdog_timer_ms" : 20000 @@ -1607,9 +1603,6 @@ } }, "module_config" : { - "device_certificates" : { - "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr" - }, "endpoints" : { "0x07" : { "default" : [ "http://x.x.x.x:3000/api/1/policies" ] diff --git a/src/components/interfaces/CMakeLists.txt b/src/components/interfaces/CMakeLists.txt index 7f1a65277d..9679ccf0b4 100644 --- a/src/components/interfaces/CMakeLists.txt +++ b/src/components/interfaces/CMakeLists.txt @@ -52,9 +52,20 @@ include_directories ( ${CMAKE_BINARY_DIR} ) -execute_process(COMMAND /usr/bin/env python3 -m pip install --upgrade --user pip setuptools wheel) set(GENERATOR_REQUIREMENTS "${CMAKE_SOURCE_DIR}/tools/InterfaceGenerator/requirements.txt") -execute_process(COMMAND /usr/bin/env python3 -m pip install --user --requirement ${GENERATOR_REQUIREMENTS}) +file(STRINGS ${GENERATOR_REQUIREMENTS} REQUIREMENTS_LIST) +execute_process(COMMAND /usr/bin/env python3 -m pip list --user OUTPUT_VARIABLE PYTHON_PACKAGES_LIST) + +foreach(REQUIREMENT_PACKAGE IN LISTS REQUIREMENTS_LIST) + string(FIND "${PYTHON_PACKAGES_LIST}" "${REQUIREMENT_PACKAGE}" PACKAGE_FOUND) + if (PACKAGE_FOUND EQUAL -1) + message(WARNING "${REQUIREMENT_PACKAGE} not found!") + endif() +endforeach() + +add_custom_target(install_python_dependencies + COMMAND /usr/bin/env python3 -m pip install --user --requirement ${GENERATOR_REQUIREMENTS} +) generate_interface("v4_protocol_v1_2_no_extra.xml" "ns_smart_device_link_rpc::V1" "sdlrpcv1") add_library(v4_protocol_v1_2_no_extra ${CMAKE_CURRENT_BINARY_DIR}/v4_protocol_v1_2_no_extra_schema.cc) diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h index 25439f835b..98f86d6ea1 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/types.h +++ b/src/components/policy/policy_external/include/policy/policy_table/types.h @@ -226,7 +226,6 @@ struct ApplicationParams : PolicyBase { Optional<AppHMITypes> AppHMIType; Optional<RequestTypes> RequestType; Optional<RequestSubTypes> RequestSubType; - Optional<Integer<uint16_t, 0, 65225> > memory_kb; Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms; mutable Optional<ModuleTypes> moduleType; Optional<String<0, 65535> > certificate; diff --git a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml index a3b91abbc5..b8ea5cf22f 100644 --- a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml +++ b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml @@ -101,7 +101,6 @@ <param name="default_hmi" type="HmiLevel" /> <param name="keep_context" type="Boolean" /> <param name="steal_focus" type="Boolean" /> - <param name="memory_kb" type="Integer" minvalue="1" maxvalue="65225" mandatory="false"/> <param name="watchdog_timer_ms" type="Integer" minvalue="1" maxvalue="65225" mandatory="false"/> <param name="certificate" type="String" minlength="0" maxlength="65535" @@ -164,7 +163,6 @@ maxsize="10" minvalue="1" maxvalue="1000" /> <struct name="ModuleConfig"> - <param name="device_certificates" type="String" minlength="1" maxlength="100" mandatory="false" map="true" minsize="1" maxsize="255" /> <param name="preloaded_pt" type="Boolean" mandatory="false" /> <param name="full_app_id_supported" type="Boolean" mandatory="false" /> <param name="exchange_after_x_ignition_cycles" type="Integer" diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc index 9e056752a8..fffa6a7848 100644 --- a/src/components/policy/policy_external/src/policy_table/types.cc +++ b/src/components/policy/policy_external/src/policy_table/types.cc @@ -347,7 +347,6 @@ ApplicationParams::ApplicationParams(const Json::Value* value__) , AppHMIType(impl::ValueMember(value__, "AppHMIType")) , RequestType(impl::ValueMember(value__, "RequestType")) , RequestSubType(impl::ValueMember(value__, "RequestSubType")) - , memory_kb(impl::ValueMember(value__, "memory_kb"), 0) , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms")) , moduleType(impl::ValueMember(value__, "moduleType")) , certificate(impl::ValueMember(value__, "certificate")) @@ -368,7 +367,6 @@ Json::Value ApplicationParams::ToJsonValue() const { impl::WriteJsonField("AppHMIType", AppHMIType, &result__); impl::WriteJsonField("RequestType", RequestType, &result__); impl::WriteJsonField("RequestSubType", RequestSubType, &result__); - impl::WriteJsonField("memory_kb", memory_kb, &result__); impl::WriteJsonField( "heart_beat_timeout_ms", heart_beat_timeout_ms, &result__); impl::WriteJsonField("moduleType", moduleType, &result__); @@ -400,9 +398,6 @@ bool ApplicationParams::is_valid() const { if (!AppHMIType.is_valid()) { return false; } - if (!memory_kb.is_valid()) { - return false; - } if (!heart_beat_timeout_ms.is_valid()) { return false; } @@ -462,9 +457,6 @@ bool ApplicationParams::struct_empty() const { if (RequestSubType.is_initialized()) { return false; } - if (memory_kb.is_initialized()) { - return false; - } if (heart_beat_timeout_ms.is_initialized()) { return false; } @@ -539,9 +531,6 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const { if (!steal_focus.is_valid()) { steal_focus.ReportErrors(&report__->ReportSubobject("steal_focus")); } - if (!memory_kb.is_valid()) { - memory_kb.ReportErrors(&report__->ReportSubobject("memory_kb")); - } if (!heart_beat_timeout_ms.is_valid()) { heart_beat_timeout_ms.ReportErrors( &report__->ReportSubobject("heart_beat_timeout_ms")); @@ -590,7 +579,6 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { AppHMIType.SetPolicyTableType(pt_type); RequestType.SetPolicyTableType(pt_type); RequestSubType.SetPolicyTableType(pt_type); - memory_kb.SetPolicyTableType(pt_type); heart_beat_timeout_ms.SetPolicyTableType(pt_type); moduleType.SetPolicyTableType(pt_type); certificate.SetPolicyTableType(pt_type); diff --git a/src/components/policy/policy_external/src/sql_pt_ext_queries.cc b/src/components/policy/policy_external/src/sql_pt_ext_queries.cc index 26d2124d07..1e7e169fe7 100644 --- a/src/components/policy/policy_external/src/sql_pt_ext_queries.cc +++ b/src/components/policy/policy_external/src/sql_pt_ext_queries.cc @@ -213,13 +213,13 @@ const std::string kUpdateGroupPermissions = const std::string kInsertApplication = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, `steal_focus`, " - " `default_hmi`, `priority_value`, `is_revoked`, `memory_kb`, " + " `default_hmi`, `priority_value`, `is_revoked`, " " `heart_beat_timeout_ms`, `certificate`, `hybrid_app_preference_value`, " " `endpoint`, `enabled`, `auth_token`, " " `cloud_transport_type`, `icon_url`, `allow_unknown_rpc_passthrough`, " "`encryption_required`) " "VALUES " - "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; const std::string kCollectFriendlyMsg = "SELECT * FROM `message`"; @@ -246,7 +246,7 @@ const std::string kSelectPreconsentedGroupsId = const std::string kSelectAppPolicies = "SELECT `id`, `priority_value`, `default_hmi`, `keep_context`, " - " `steal_focus`, `memory_kb`, `heart_beat_timeout_ms`, `certificate`, " + " `steal_focus`, `heart_beat_timeout_ms`, `certificate`, " " `hybrid_app_preference_value`, `endpoint`, `enabled`, `auth_token`, " " `cloud_transport_type`, `icon_url`, `allow_unknown_rpc_passthrough`, " "`encryption_required`" diff --git a/src/components/policy/policy_external/src/sql_pt_ext_representation.cc b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc index fc35551808..b98f14f1c8 100644 --- a/src/components/policy/policy_external/src/sql_pt_ext_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc @@ -774,36 +774,34 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy( app_query.Bind( 4, std::string(policy_table::EnumToJsonString(app.second.priority))); app_query.Bind(5, app.second.is_null()); - app_query.Bind(6, *app.second.memory_kb); - app_query.Bind(7, static_cast<int64_t>(*app.second.heart_beat_timeout_ms)); + app_query.Bind(6, static_cast<int64_t>(*app.second.heart_beat_timeout_ms)); app.second.certificate.is_initialized() - ? app_query.Bind(8, *app.second.certificate) - : app_query.Bind(8); + ? app_query.Bind(7, *app.second.certificate) + : app_query.Bind(7); app.second.hybrid_app_preference.is_initialized() - ? app_query.Bind(9, + ? app_query.Bind(8, std::string(policy_table::EnumToJsonString( *app.second.hybrid_app_preference))) - : app_query.Bind(9); - app.second.endpoint.is_initialized() - ? app_query.Bind(10, *app.second.endpoint) - : app_query.Bind(10); - app.second.enabled.is_initialized() ? app_query.Bind(11, *app.second.enabled) - : app_query.Bind(11); + : app_query.Bind(8); + app.second.endpoint.is_initialized() ? app_query.Bind(9, *app.second.endpoint) + : app_query.Bind(9); + app.second.enabled.is_initialized() ? app_query.Bind(10, *app.second.enabled) + : app_query.Bind(10); app.second.auth_token.is_initialized() - ? app_query.Bind(12, *app.second.auth_token) - : app_query.Bind(12); + ? app_query.Bind(11, *app.second.auth_token) + : app_query.Bind(11); app.second.cloud_transport_type.is_initialized() - ? app_query.Bind(13, *app.second.cloud_transport_type) - : app_query.Bind(13); + ? app_query.Bind(12, *app.second.cloud_transport_type) + : app_query.Bind(12); app.second.icon_url.is_initialized() - ? app_query.Bind(14, *app.second.icon_url) - : app_query.Bind(14); + ? app_query.Bind(13, *app.second.icon_url) + : app_query.Bind(13); app.second.allow_unknown_rpc_passthrough.is_initialized() - ? app_query.Bind(15, *app.second.allow_unknown_rpc_passthrough) - : app_query.Bind(15); + ? app_query.Bind(14, *app.second.allow_unknown_rpc_passthrough) + : app_query.Bind(14); app.second.encryption_required.is_initialized() - ? app_query.Bind(16, *app.second.encryption_required) - : app_query.Bind(16); + ? app_query.Bind(15, *app.second.encryption_required) + : app_query.Bind(15); if (!app_query.Exec() || !app_query.Reset()) { SDL_LOG_WARN("Incorrect insert into application."); @@ -927,28 +925,27 @@ bool SQLPTExtRepresentation::GatherApplicationPoliciesSection( params.default_hmi = hmi; params.keep_context = query.GetBoolean(3); params.steal_focus = query.GetBoolean(4); - *params.memory_kb = query.GetInteger(5); - *params.heart_beat_timeout_ms = query.GetUInteger(6); - if (!query.IsNull(7)) { - *params.certificate = query.GetString(7); + *params.heart_beat_timeout_ms = query.GetUInteger(5); + if (!query.IsNull(6)) { + *params.certificate = query.GetString(6); } // Read cloud app properties policy_table::HybridAppPreference hap; - bool valid = policy_table::EnumFromJsonString(query.GetString(8), &hap); + bool valid = policy_table::EnumFromJsonString(query.GetString(7), &hap); if (valid) { *params.hybrid_app_preference = hap; } - *params.endpoint = query.GetString(9); - if (!query.IsNull(10)) { - *params.enabled = query.GetBoolean(10); + *params.endpoint = query.GetString(8); + if (!query.IsNull(9)) { + *params.enabled = query.GetBoolean(9); } - *params.auth_token = query.GetString(11); - *params.cloud_transport_type = query.GetString(12); - *params.icon_url = query.GetString(13); - *params.allow_unknown_rpc_passthrough = query.GetBoolean(14); - if (!query.IsNull(15)) { - *params.encryption_required = query.GetBoolean(15); + *params.auth_token = query.GetString(10); + *params.cloud_transport_type = query.GetString(11); + *params.icon_url = query.GetString(12); + *params.allow_unknown_rpc_passthrough = query.GetBoolean(13); + if (!query.IsNull(14)) { + *params.encryption_required = query.GetBoolean(14); } const auto& gather_app_id = ((*policies).apps[app_id].is_string()) ? (*policies).apps[app_id].get_string() diff --git a/src/components/policy/policy_external/src/sql_pt_queries.cc b/src/components/policy/policy_external/src/sql_pt_queries.cc index c5fc3a9e92..91dd6fb713 100644 --- a/src/components/policy/policy_external/src/sql_pt_queries.cc +++ b/src/components/policy/policy_external/src/sql_pt_queries.cc @@ -162,7 +162,6 @@ const std::string kCreateSchema = " `is_revoked` BOOLEAN, " " `is_default` BOOLEAN, " " `is_predata` BOOLEAN, " - " `memory_kb` INTEGER NOT NULL, " " `heart_beat_timeout_ms` INTEGER NOT NULL, " " `certificate` VARCHAR(65535), " " `hybrid_app_preference_value` VARCHAR(255), " @@ -821,12 +820,12 @@ const std::string kInsertRpcWithParameter = const std::string kInsertApplication = "INSERT OR IGNORE INTO `application` (`id`, `priority_value`, " - "`is_revoked`, `memory_kb`, `heart_beat_timeout_ms`, `certificate`, " + "`is_revoked`, `heart_beat_timeout_ms`, `certificate`, " "`hybrid_app_preference_value`, `endpoint`, `enabled`, `auth_token`, " "`cloud_transport_type`, `icon_url`, `allow_unknown_rpc_passthrough`, " "`encryption_required`) " "VALUES " - "(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "(?,?,?,?,?,?,?,?,?,?,?,?,?)"; const std::string kInsertAppGroup = "INSERT INTO `app_group` (`application_id`, `functional_group_id`)" @@ -972,7 +971,7 @@ const std::string kSelectUserMsgsVersion = "SELECT DISTINCT `number` FROM `version`"; const std::string kSelectAppPolicies = - "SELECT `id`, `priority_value`, `memory_kb`, " + "SELECT `id`, `priority_value`, " " `heart_beat_timeout_ms`, `certificate`, `hybrid_app_preference_value`, " " `endpoint`, `enabled`, `auth_token`, `cloud_transport_type`, `icon_url`, " " `allow_unknown_rpc_passthrough`, `encryption_required` " @@ -1103,15 +1102,15 @@ const std::string kDeleteAppGroupByApplicationId = const std::string kInsertApplicationFull = "INSERT OR IGNORE INTO `application` (`id`, `keep_context`, `steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - " `is_predata`, `memory_kb`, `heart_beat_timeout_ms`, " + " `is_predata`, `heart_beat_timeout_ms`, " " `certificate`, `hybrid_app_preference_value`, `endpoint`, `enabled`, " " `auth_token`, `cloud_transport_type`, `icon_url`, " "`allow_unknown_rpc_passthrough`, `encryption_required`) " - " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; const std::string kSelectApplicationFull = "SELECT `keep_context`, `steal_focus`, `default_hmi`, `priority_value`, " - " `is_revoked`, `is_default`, `is_predata`, `memory_kb`," + " `is_revoked`, `is_default`, `is_predata`, " " `heart_beat_timeout_ms`, `certificate`, `hybrid_app_preference_value`, " " `endpoint`, `enabled`, `auth_token`, `cloud_transport_type`, " "`icon_url`, " diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index 3309893db0..1570675cf9 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -766,33 +766,32 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection( policy_table::EnumFromJsonString(query.GetString(1), &priority); params.priority = priority; - *params.memory_kb = query.GetInteger(2); - *params.heart_beat_timeout_ms = query.GetUInteger(3); + *params.heart_beat_timeout_ms = query.GetUInteger(2); - if (!query.IsNull(4)) { - *params.certificate = query.GetString(4); + if (!query.IsNull(3)) { + *params.certificate = query.GetString(3); } // Read cloud app properties policy_table::HybridAppPreference hap; - bool valid = policy_table::EnumFromJsonString(query.GetString(5), &hap); + bool valid = policy_table::EnumFromJsonString(query.GetString(4), &hap); if (valid) { *params.hybrid_app_preference = hap; } - *params.endpoint = query.GetString(6); - if (!query.IsNull(7)) { - *params.enabled = query.GetBoolean(7); + *params.endpoint = query.GetString(5); + if (!query.IsNull(6)) { + *params.enabled = query.GetBoolean(6); } - *params.auth_token = query.GetString(8); - *params.cloud_transport_type = query.GetString(9); - *params.icon_url = query.GetString(10); - *params.allow_unknown_rpc_passthrough = query.GetBoolean(11); + *params.auth_token = query.GetString(7); + *params.cloud_transport_type = query.GetString(8); + *params.icon_url = query.GetString(9); + *params.allow_unknown_rpc_passthrough = query.GetBoolean(10); const auto& gather_app_id = ((*policies).apps[app_id].is_string()) ? (*policies).apps[app_id].get_string() : app_id; - if (!query.IsNull(12)) { - *params.encryption_required = query.GetBoolean(12); + if (!query.IsNull(11)) { + *params.encryption_required = query.GetBoolean(11); } // Data should be gathered from db by "default" key if application has // default policies @@ -1122,36 +1121,35 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy( app_query.Bind( 1, std::string(policy_table::EnumToJsonString(app.second.priority))); app_query.Bind(2, app.second.is_null()); - app_query.Bind(3, *app.second.memory_kb); - app_query.Bind(4, static_cast<int64_t>(*app.second.heart_beat_timeout_ms)); + app_query.Bind(3, static_cast<int64_t>(*app.second.heart_beat_timeout_ms)); app.second.certificate.is_initialized() - ? app_query.Bind(5, *app.second.certificate) - : app_query.Bind(5); + ? app_query.Bind(4, *app.second.certificate) + : app_query.Bind(4); app.second.hybrid_app_preference.is_initialized() - ? app_query.Bind(6, + ? app_query.Bind(5, std::string(policy_table::EnumToJsonString( *app.second.hybrid_app_preference))) - : app_query.Bind(6); - app.second.endpoint.is_initialized() ? app_query.Bind(7, *app.second.endpoint) - : app_query.Bind(7); - app.second.enabled.is_initialized() ? app_query.Bind(8, *app.second.enabled) - : app_query.Bind(8); + : app_query.Bind(5); + app.second.endpoint.is_initialized() ? app_query.Bind(6, *app.second.endpoint) + : app_query.Bind(6); + app.second.enabled.is_initialized() ? app_query.Bind(7, *app.second.enabled) + : app_query.Bind(7); app.second.auth_token.is_initialized() - ? app_query.Bind(9, *app.second.auth_token) - : app_query.Bind(9); + ? app_query.Bind(8, *app.second.auth_token) + : app_query.Bind(8); app.second.cloud_transport_type.is_initialized() - ? app_query.Bind(10, *app.second.cloud_transport_type) - : app_query.Bind(10); + ? app_query.Bind(9, *app.second.cloud_transport_type) + : app_query.Bind(9); app.second.icon_url.is_initialized() - ? app_query.Bind(11, *app.second.icon_url) - : app_query.Bind(11); + ? app_query.Bind(10, *app.second.icon_url) + : app_query.Bind(10); app.second.allow_unknown_rpc_passthrough.is_initialized() - ? app_query.Bind(12, *app.second.allow_unknown_rpc_passthrough) - : app_query.Bind(12); + ? app_query.Bind(11, *app.second.allow_unknown_rpc_passthrough) + : app_query.Bind(11); app.second.encryption_required.is_initialized() - ? app_query.Bind(13, *app.second.encryption_required) - : app_query.Bind(13); + ? app_query.Bind(12, *app.second.encryption_required) + : app_query.Bind(12); if (!app_query.Exec() || !app_query.Reset()) { SDL_LOG_WARN("Incorrect insert into application."); diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_storage_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_storage_test.cc index 09df17beb2..3bbdc05378 100644 --- a/src/components/policy/policy_external/test/sql_pt_ext_representation_storage_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_storage_test.cc @@ -98,9 +98,9 @@ TEST_F( // Act const std::string value_12345 = "12345"; const std::string query_insert_12345 = - "INSERT INTO `application` (`id`, `memory_kb`," + "INSERT INTO `application` (`id`, " " `heart_beat_timeout_ms`, `keep_context`) VALUES ('" + - value_12345 + "', 5, 10, 1)"; + value_12345 + "', 10, 1)"; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_12345)); @@ -110,9 +110,9 @@ TEST_F( // Act const std::string value_123 = "123"; const std::string query_insert_123 = - "INSERT INTO `application` (`id`, `memory_kb`," + "INSERT INTO `application` (`id`, " " `heart_beat_timeout_ms`, `keep_context`) VALUES ('" + - value_123 + "', 10, 7, 0)"; + value_123 + "', 7, 0)"; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_123)); diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc index 58f526d7d3..c677392ef9 100644 --- a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc @@ -456,8 +456,8 @@ TEST_F( ASSERT_TRUE(query_wrapper_->Exec(query_delete)); // Act const std::string query_insert_12345 = - "INSERT INTO `application` (`id`, `memory_kb`," - " `heart_beat_timeout_ms`, `keep_context`) VALUES ('12345', 5, 10, 1)"; + "INSERT INTO `application` (`id`, " + " `heart_beat_timeout_ms`, `keep_context`) VALUES ('12345', 10, 1)"; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_12345)); @@ -465,8 +465,8 @@ TEST_F( EXPECT_TRUE(reps_->CanAppKeepContext("12345")); // Act const std::string query_insert_123 = - "INSERT INTO `application` (`id`, `memory_kb`," - " `heart_beat_timeout_ms`, `keep_context`) VALUES ('123', 10, 7, 0)"; + "INSERT INTO `application` (`id`, " + " `heart_beat_timeout_ms`, `keep_context`) VALUES ('123', 7, 0)"; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_123)); @@ -481,8 +481,8 @@ TEST_F(SQLPTExtRepresentationTest, ASSERT_TRUE(query_wrapper_->Exec(query_delete)); // Act const std::string query_insert_12345 = - "INSERT INTO `application` (`id`, `memory_kb`," - " `heart_beat_timeout_ms`, `steal_focus`) VALUES ('12345', 5, 10, 1)"; + "INSERT INTO `application` (`id`, " + " `heart_beat_timeout_ms`, `steal_focus`) VALUES ('12345', 10, 1)"; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_12345)); @@ -490,8 +490,8 @@ TEST_F(SQLPTExtRepresentationTest, EXPECT_FALSE(reps_->CanAppStealFocus("0")); // Act const std::string query_insert_123 = - "INSERT INTO `application` (`id`, `memory_kb`," - " `heart_beat_timeout_ms`, `steal_focus`) VALUES ('123', 10, 7, 0)"; + "INSERT INTO `application` (`id`, " + " `heart_beat_timeout_ms`, `steal_focus`) VALUES ('123', 7, 0)"; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_123)); @@ -506,8 +506,8 @@ TEST_F(SQLPTExtRepresentationTest, ASSERT_TRUE(query_wrapper_->Exec(query_delete)); // Act const std::string query_insert_12345 = - "INSERT INTO `application` (`id`, `memory_kb`," - " `heart_beat_timeout_ms`, `default_hmi`) VALUES ('12345', 5, 10, " + "INSERT INTO `application` (`id`, " + " `heart_beat_timeout_ms`, `default_hmi`) VALUES ('12345', 10, " "'NONE')"; std::string result; // Assert @@ -515,8 +515,8 @@ TEST_F(SQLPTExtRepresentationTest, EXPECT_TRUE(reps_->GetDefaultHMI("12345", &result)); EXPECT_EQ("NONE", result); const std::string query_insert_123 = - "INSERT INTO `application` (`id`, `memory_kb`," - " `heart_beat_timeout_ms`, `default_hmi`) VALUES ('123', 5, 10, " + "INSERT INTO `application` (`id`, " + " `heart_beat_timeout_ms`, `default_hmi`) VALUES ('123', 10, " "'LIMITED')"; // Assert @@ -898,9 +898,9 @@ TEST_F( ASSERT_TRUE(query_wrapper_->Exec(query_insert_functional_group)); const std::string query_insert_application = - "INSERT INTO `application` (`id`, `memory_kb`," + "INSERT INTO `application` (`id`, " " `heart_beat_timeout_ms`, `is_predata`, `keep_context`) VALUES ('1234', " - "5, 10, 1, 0)"; + "10, 1, 0)"; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_application)); @@ -967,9 +967,9 @@ TEST_F( ASSERT_TRUE(query_wrapper_->Exec(query_insert_preconsented_group)); const std::string query_insert_application = - "INSERT INTO `application` (`id`, `memory_kb`," + "INSERT INTO `application` (`id`, " " `heart_beat_timeout_ms`, `is_predata`, `keep_context`) VALUES ('1234', " - "5, 10, 0, 0)"; + "10, 0, 0)"; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_application)); FunctionalIdType group_types; @@ -1417,9 +1417,9 @@ TEST_F( "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, 0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app)); GroupsAliasNameCollection allowed_groups; @@ -1447,9 +1447,9 @@ TEST_F(SQLPTExtRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, 0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app)); GroupsAliasNameCollection allowed_groups; @@ -1479,9 +1479,9 @@ TEST_F( "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, 0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app)); GroupsAliasNameCollection allowed_groups; @@ -1506,9 +1506,9 @@ TEST_F(SQLPTExtRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, 0, " - "1, 64, 10) "; + "1, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app)); // Check EXPECT_TRUE(reps_->IsPredataPolicy("12345")); diff --git a/src/components/policy/policy_external/test/sql_pt_representation_storage_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_storage_test.cc index 7214ecba81..f9d36eb013 100644 --- a/src/components/policy/policy_external/test/sql_pt_representation_storage_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_representation_storage_test.cc @@ -90,10 +90,10 @@ TEST_F( const std::string gps = "gps"; const std::string speed = "speed"; const std::string query = - "INSERT OR REPLACE INTO `application` (`id`, `memory_kb`," + "INSERT OR REPLACE INTO `application` (`id`," " `heart_beat_timeout_ms`) VALUES ('" + value_12345 + - "', 5, 10); " + "', 10); " "INSERT OR REPLACE INTO functional_group (`id`, `name`)" " VALUES (1, 'Base-4'); " "INSERT OR REPLACE INTO `app_group` (`application_id`," diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc index 548b6f3666..9047949860 100644 --- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc @@ -149,7 +149,6 @@ class SQLPTRepresentationTest : public SQLPTRepresentation, uint16_t apps_size, policy_table::Priority prio, const std::string& section, - uint16_t memory_kb, uint32_t heart_beat_timeout_ms, policy_table::Strings& groups) const { if (section != "device") { @@ -163,7 +162,6 @@ class SQLPTRepresentationTest : public SQLPTRepresentation, EXPECT_EQ(0u, (*(apps_iter->second.nicknames)).size()); EXPECT_EQ(prio, (apps_iter->second).priority); EXPECT_EQ(0u, (*(apps_iter->second.AppHMIType)).size()); - EXPECT_EQ(memory_kb, (*(apps_iter->second.memory_kb))); EXPECT_EQ(heart_beat_timeout_ms, (*(apps_iter->second.heart_beat_timeout_ms))); } else { @@ -461,8 +459,8 @@ TEST_F( CheckPermissionsAllowed_SetValuesInAppGroupRpcFunctionalGroup_GetEqualParamsInCheckPermissionResult) { // Arrange const std::string query = - "INSERT OR REPLACE INTO `application` (`id`, `memory_kb`," - " `heart_beat_timeout_ms`) VALUES ('12345', 5, 10); " + "INSERT OR REPLACE INTO `application` (`id`, " + " `heart_beat_timeout_ms`) VALUES ('12345', 10); " "INSERT OR REPLACE INTO functional_group (`id`, `name`)" " VALUES (1, 'Base-4'); " "INSERT OR REPLACE INTO `app_group` (`application_id`," @@ -493,8 +491,8 @@ TEST_F( CheckPermissionsAllowedWithoutParameters_SetLimitedPermissions_ExpectEmptyListOfAllowedParams) { // Arrange const std::string query = - "INSERT OR REPLACE INTO `application` (`id`, `memory_kb`," - " `heart_beat_timeout_ms`) VALUES ('12345', 5, 10); " + "INSERT OR REPLACE INTO `application` (`id`, " + " `heart_beat_timeout_ms`) VALUES ('12345', 10); " "INSERT OR REPLACE INTO functional_group (`id`, `name`)" " VALUES (1, 'Base-4'); " "INSERT OR REPLACE INTO `app_group` (`application_id`," @@ -961,40 +959,40 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, " "0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default)); const std::string query_insert_app_pre_DataConsent = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'pre_DataConsent', 0, 0, 'NONE', " "'NONE', 0, 0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_pre_DataConsent)); const std::string query_insert_app_device = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', " "'COMMUNICATION', 0, 0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_device)); const std::string query_insert_app_12345 = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', " "0, 0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_12345)); std::string priority; @@ -1051,40 +1049,40 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, " "0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default)); const std::string query_insert_app_pre_DataConsent = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'pre_DataConsent', 0, 0, 'NONE', " "'NONE', 0, 0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_pre_DataConsent)); const std::string query_insert_app_device = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', " "'COMMUNICATION', 0, 0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_device)); const std::string query_insert_app_12345 = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', " "0, 0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_12345)); const std::string query_insert = @@ -1241,29 +1239,29 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, " "0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default)); const std::string query_insert_app_device = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', " - "'COMMUNICATION', 0, 0, 0, 64, 10) "; + "'COMMUNICATION', 0, 0, 0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_device)); const std::string query_insert_app_12345 = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', " "0, 0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_12345)); // Checks EXPECT_TRUE(reps->IsApplicationRepresented("default")); @@ -1279,20 +1277,20 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '7777', 0, 0, 'NONE', 'NONE', 1, " "0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_7777)); const std::string query_insert_app_12345 = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', " "0, 0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_12345)); // Checks EXPECT_TRUE(reps->IsApplicationRevoked("7777")); @@ -1306,19 +1304,19 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, " "1, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default)); const std::string query_insert_app_123 = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '123', 1, 0, 'FULL', " - "'COMMUNICATION', 1, 1, 0, 64, 10) "; + "'COMMUNICATION', 1, 1, 0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_123)); EXPECT_FALSE(reps->IsApplicationRepresented("7777")); EXPECT_FALSE(reps->IsApplicationRepresented("9999")); @@ -1348,10 +1346,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, " "0, " - "1, 64, 10) "; + "1, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app)); // Check EXPECT_FALSE(reps->IsDefaultPolicy("12345")); @@ -1363,8 +1361,8 @@ TEST_F(SQLPTRepresentationTest, const std::string query_insert_app = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, " - "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) " - "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 1, 0, 64, 10) "; + "`is_default`, `is_predata`, `heart_beat_timeout_ms`) " + "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 1, 0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app)); // Check @@ -1404,17 +1402,17 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, " "0, " - "0, 64, 10) "; + "0, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default)); const std::string query_insert_app_1234567 = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, " - "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) " - "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 0, 1, 64, 10) "; + "`is_default`, `is_predata`, `heart_beat_timeout_ms`) " + "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 0, 1, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_1234567)); EXPECT_FALSE(reps->IsDefaultPolicy("1234567")); // Act @@ -1448,8 +1446,8 @@ TEST_F(SQLPTRepresentationTest, const std::string query_insert_app = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, " - "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) " - "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 0, 1, 64, 10) "; + "`is_default`, `is_predata`, `heart_beat_timeout_ms`) " + "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 0, 1, 10) "; ASSERT_TRUE(query_wrapper_->Exec(query_insert_app)); const std::string query_select = "SELECT `is_default` FROM `application`WHERE`id`= '1234567' "; diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h index 7eeb41f064..664987b70f 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/types.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h @@ -193,7 +193,6 @@ struct ApplicationParams : PolicyBase { Optional<AppHMITypes> AppHMIType; Optional<RequestTypes> RequestType; Optional<RequestSubTypes> RequestSubType; - Optional<Integer<uint16_t, 0, 65225> > memory_kb; Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms; Optional<String<0, 65535> > certificate; mutable Optional<ModuleTypes> moduleType; @@ -312,7 +311,6 @@ struct EndpointProperty : CompositeType { struct ModuleConfig : CompositeType { public: - Optional<Map<String<0, 100>, 0, 255> > device_certificates; Optional<Boolean> preloaded_pt; Optional<Boolean> full_app_id_supported; Integer<uint8_t, 0, 255> exchange_after_x_ignition_cycles; diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc index 8b937f3142..6b1ba15cfd 100644 --- a/src/components/policy/policy_regular/src/policy_table/types.cc +++ b/src/components/policy/policy_regular/src/policy_table/types.cc @@ -272,7 +272,6 @@ ApplicationParams::ApplicationParams(const Json::Value* value__) , AppHMIType(impl::ValueMember(value__, "AppHMIType")) , RequestType(impl::ValueMember(value__, "RequestType")) , RequestSubType(impl::ValueMember(value__, "RequestSubType")) - , memory_kb(impl::ValueMember(value__, "memory_kb"), 0) , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms")) , certificate(impl::ValueMember(value__, "certificate")) , moduleType(impl::ValueMember(value__, "moduleType")) @@ -294,7 +293,6 @@ Json::Value ApplicationParams::ToJsonValue() const { impl::WriteJsonField("AppHMIType", AppHMIType, &result__); impl::WriteJsonField("RequestType", RequestType, &result__); impl::WriteJsonField("RequestSubType", RequestSubType, &result__); - impl::WriteJsonField("memory_kb", memory_kb, &result__); impl::WriteJsonField( "heart_beat_timeout_ms", heart_beat_timeout_ms, &result__); impl::WriteJsonField("certificate", certificate, &result__); @@ -331,9 +329,6 @@ bool ApplicationParams::is_valid() const { if (!AppHMIType.is_valid()) { return false; } - if (!memory_kb.is_valid()) { - return false; - } if (!heart_beat_timeout_ms.is_valid()) { return false; } @@ -396,9 +391,6 @@ bool ApplicationParams::struct_empty() const { if (RequestSubType.is_initialized()) { return false; } - if (memory_kb.is_initialized()) { - return false; - } if (heart_beat_timeout_ms.is_initialized()) { return false; } @@ -460,9 +452,6 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const { if (!priority.is_valid()) { priority.ReportErrors(&report__->ReportSubobject("priority")); } - if (!memory_kb.is_valid()) { - memory_kb.ReportErrors(&report__->ReportSubobject("memory_kb")); - } if (!heart_beat_timeout_ms.is_valid()) { heart_beat_timeout_ms.ReportErrors( &report__->ReportSubobject("heart_beat_timeout_ms")); @@ -512,7 +501,6 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { AppHMIType.SetPolicyTableType(pt_type); RequestType.SetPolicyTableType(pt_type); RequestSubType.SetPolicyTableType(pt_type); - memory_kb.SetPolicyTableType(pt_type); heart_beat_timeout_ms.SetPolicyTableType(pt_type); certificate.SetPolicyTableType(pt_type); moduleType.SetPolicyTableType(pt_type); @@ -741,7 +729,6 @@ ModuleConfig::~ModuleConfig() {} ModuleConfig::ModuleConfig(const Json::Value* value__) : CompositeType(InitHelper(value__, &Json::Value::isObject)) - , device_certificates(impl::ValueMember(value__, "device_certificates")) , preloaded_pt(impl::ValueMember(value__, "preloaded_pt")) , full_app_id_supported(impl::ValueMember(value__, "full_app_id_supported")) , exchange_after_x_ignition_cycles( @@ -768,8 +755,6 @@ ModuleConfig::ModuleConfig(const Json::Value* value__) impl::ValueMember(value__, "lock_screen_dismissal_enabled")) {} void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) { - // device_certificates = from.device_certificates; // According to the - // requirements this is optional. exchange_after_x_ignition_cycles = from.exchange_after_x_ignition_cycles; exchange_after_x_kilometers = from.exchange_after_x_kilometers; exchange_after_x_days = from.exchange_after_x_days; @@ -944,10 +929,6 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { if (struct_empty()) { rpc::CompositeType::ReportErrors(report__); } - if (!device_certificates.is_valid()) { - device_certificates.ReportErrors( - &report__->ReportSubobject("device_certificates")); - } if (!preloaded_pt.is_valid()) { preloaded_pt.ReportErrors(&report__->ReportSubobject("preloaded_pt")); } diff --git a/src/components/policy/policy_regular/src/sql_pt_queries.cc b/src/components/policy/policy_regular/src/sql_pt_queries.cc index a58867966c..6e0bfd8c89 100644 --- a/src/components/policy/policy_regular/src/sql_pt_queries.cc +++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc @@ -152,7 +152,6 @@ const std::string kCreateSchema = " `is_revoked` BOOLEAN, " " `is_default` BOOLEAN, " " `is_predata` BOOLEAN, " - " `memory_kb` INTEGER NOT NULL, " " `heart_beat_timeout_ms` INTEGER NOT NULL, " " `certificate` VARCHAR(65535), " " `hybrid_app_preference_value` VARCHAR(255), " @@ -778,12 +777,12 @@ const std::string kInsertRpcWithParameter = const std::string kInsertApplication = "INSERT OR IGNORE INTO `application` (`id`, `priority_value`, " - "`is_revoked`, `memory_kb`, `heart_beat_timeout_ms`, `certificate`, " + "`is_revoked`, `heart_beat_timeout_ms`, `certificate`, " "`hybrid_app_preference_value`, `endpoint`, `enabled`, `auth_token`, " "`cloud_transport_type`, `icon_url`, `allow_unknown_rpc_passthrough` " ",`encryption_required`) " "VALUES " - "(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "(?,?,?,?,?,?,?,?,?,?,?,?,?)"; const std::string kInsertAppGroup = "INSERT INTO `app_group` (`application_id`, `functional_group_id`)" @@ -916,7 +915,7 @@ const std::string kSelectUserMsgsVersion = "SELECT DISTINCT `number` FROM `version`"; const std::string kSelectAppPolicies = - "SELECT `id`, `priority_value`, `memory_kb`, " + "SELECT `id`, `priority_value`, " " `heart_beat_timeout_ms`, `certificate`, `hybrid_app_preference_value`, " " `endpoint`, `enabled`, `auth_token`, `cloud_transport_type`, `icon_url`, " " `allow_unknown_rpc_passthrough`, `encryption_required`" @@ -1047,16 +1046,16 @@ const std::string kDeleteAppGroupByApplicationId = const std::string kInsertApplicationFull = "INSERT OR IGNORE INTO `application` (`id`, `keep_context`, `steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - " `is_predata`, `memory_kb`, `heart_beat_timeout_ms`, " + " `is_predata`, `heart_beat_timeout_ms`, " " `certificate`, `hybrid_app_preference_value`, `endpoint`, `enabled`, " " `auth_token`, `cloud_transport_type`, `icon_url`, " "`allow_unknown_rpc_passthrough`, `encryption_required`)" - " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; const std::string kSelectApplicationFull = "SELECT `keep_context`, `steal_focus`, `default_hmi`, " "`priority_value`, " - " `is_revoked`, `is_default`, `is_predata`, `memory_kb`," + " `is_revoked`, `is_default`, `is_predata`, " " `heart_beat_timeout_ms`, `certificate`, `hybrid_app_preference_value`, " " `endpoint`, `enabled`, `auth_token`, `cloud_transport_type`, " "`icon_url`, " diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index 1f24ca9472..0496896b60 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -772,30 +772,28 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection( policy_table::EnumFromJsonString(query.GetString(1), &priority); params.priority = priority; - *params.memory_kb = query.GetInteger(2); - - *params.heart_beat_timeout_ms = query.GetUInteger(3); - if (!query.IsNull(4)) { - *params.certificate = query.GetString(4); + *params.heart_beat_timeout_ms = query.GetUInteger(2); + if (!query.IsNull(3)) { + *params.certificate = query.GetString(3); } // Read cloud app properties policy_table::HybridAppPreference hap; - bool valid = policy_table::EnumFromJsonString(query.GetString(5), &hap); + bool valid = policy_table::EnumFromJsonString(query.GetString(4), &hap); if (valid) { *params.hybrid_app_preference = hap; } - *params.endpoint = query.GetString(6); - if (!query.IsNull(7)) { - *params.enabled = query.GetBoolean(7); + *params.endpoint = query.GetString(5); + if (!query.IsNull(6)) { + *params.enabled = query.GetBoolean(6); } - *params.auth_token = query.GetString(8); - *params.cloud_transport_type = query.GetString(9); - *params.icon_url = query.GetString(10); - *params.allow_unknown_rpc_passthrough = query.GetBoolean(11); + *params.auth_token = query.GetString(7); + *params.cloud_transport_type = query.GetString(8); + *params.icon_url = query.GetString(9); + *params.allow_unknown_rpc_passthrough = query.GetBoolean(10); - if (!query.IsNull(12)) { - *params.encryption_required = query.GetBoolean(12); + if (!query.IsNull(11)) { + *params.encryption_required = query.GetBoolean(11); } const auto& gather_app_id = ((*policies).apps[app_id].is_string()) @@ -1116,36 +1114,35 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy( app_query.Bind( 1, std::string(policy_table::EnumToJsonString(app.second.priority))); app_query.Bind(2, app.second.is_null()); - app_query.Bind(3, *app.second.memory_kb); - app_query.Bind(4, static_cast<int64_t>(*app.second.heart_beat_timeout_ms)); + app_query.Bind(3, static_cast<int64_t>(*app.second.heart_beat_timeout_ms)); app.second.certificate.is_initialized() - ? app_query.Bind(5, *app.second.certificate) - : app_query.Bind(5); + ? app_query.Bind(4, *app.second.certificate) + : app_query.Bind(4); app.second.hybrid_app_preference.is_initialized() - ? app_query.Bind(6, + ? app_query.Bind(5, std::string(policy_table::EnumToJsonString( *app.second.hybrid_app_preference))) - : app_query.Bind(6); - app.second.endpoint.is_initialized() ? app_query.Bind(7, *app.second.endpoint) - : app_query.Bind(7); - app.second.enabled.is_initialized() ? app_query.Bind(8, *app.second.enabled) - : app_query.Bind(8); + : app_query.Bind(5); + app.second.endpoint.is_initialized() ? app_query.Bind(6, *app.second.endpoint) + : app_query.Bind(6); + app.second.enabled.is_initialized() ? app_query.Bind(7, *app.second.enabled) + : app_query.Bind(7); app.second.auth_token.is_initialized() - ? app_query.Bind(9, *app.second.auth_token) - : app_query.Bind(9); + ? app_query.Bind(8, *app.second.auth_token) + : app_query.Bind(8); app.second.cloud_transport_type.is_initialized() - ? app_query.Bind(10, *app.second.cloud_transport_type) - : app_query.Bind(10); + ? app_query.Bind(9, *app.second.cloud_transport_type) + : app_query.Bind(9); app.second.icon_url.is_initialized() - ? app_query.Bind(11, *app.second.icon_url) - : app_query.Bind(11); + ? app_query.Bind(10, *app.second.icon_url) + : app_query.Bind(10); app.second.allow_unknown_rpc_passthrough.is_initialized() - ? app_query.Bind(12, *app.second.allow_unknown_rpc_passthrough) - : app_query.Bind(12); + ? app_query.Bind(11, *app.second.allow_unknown_rpc_passthrough) + : app_query.Bind(11); app.second.encryption_required.is_initialized() - ? app_query.Bind(13, *app.second.encryption_required) - : app_query.Bind(13); + ? app_query.Bind(12, *app.second.encryption_required) + : app_query.Bind(12); if (!app_query.Exec() || !app_query.Reset()) { SDL_LOG_WARN("Incorrect insert into application."); diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_storage_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_storage_test.cc index f719edf391..3277706dfc 100644 --- a/src/components/policy/policy_regular/test/sql_pt_representation_storage_test.cc +++ b/src/components/policy/policy_regular/test/sql_pt_representation_storage_test.cc @@ -102,10 +102,10 @@ TEST_F( // Arrange const std::string value_12345 = "12345"; const std::string query = - "INSERT OR REPLACE INTO `application` (`id`, `memory_kb`," + "INSERT OR REPLACE INTO `application` (`id`," " `heart_beat_timeout_ms`) VALUES ('" + value_12345 + - "', 5, 10); " + "', 10); " "INSERT OR REPLACE INTO functional_group (`id`, `name`)" " VALUES (1, 'Base-4'); " "INSERT OR REPLACE INTO `app_group` (`application_id`," diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc index fb64dfe7d0..d0044c7b75 100644 --- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc @@ -192,7 +192,6 @@ class SQLPTRepresentationTest : protected SQLPTRepresentation, uint16_t apps_size, policy_table::Priority prio, const std::string& section, - uint16_t memory_kb, uint32_t heart_beat_timeout_ms, policy_table::Strings& groups) const { if (section != "device") { @@ -206,7 +205,6 @@ class SQLPTRepresentationTest : protected SQLPTRepresentation, EXPECT_EQ(0u, (*(apps_iter->second.nicknames)).size()); EXPECT_EQ(prio, apps_iter->second.priority); EXPECT_EQ(0u, (*(apps_iter->second.AppHMIType)).size()); - EXPECT_EQ(memory_kb, (*(apps_iter->second.memory_kb))); EXPECT_EQ(heart_beat_timeout_ms, (*(apps_iter->second.heart_beat_timeout_ms))); } else { @@ -532,8 +530,8 @@ TEST_F( CheckPermissionsAllowed_SetValuesInAppGroupRpcFunctionalGroup_GetEqualParamsInCheckPermissionResult) { // Arrange const std::string query = - "INSERT OR REPLACE INTO `application` (`id`, `memory_kb`," - " `heart_beat_timeout_ms`) VALUES ('12345', 5, 10); " + "INSERT OR REPLACE INTO `application` (`id`," + " `heart_beat_timeout_ms`) VALUES ('12345', 10); " "INSERT OR REPLACE INTO functional_group (`id`, `name`)" " VALUES (1, 'Base-4'); " "INSERT OR REPLACE INTO `app_group` (`application_id`," @@ -563,8 +561,8 @@ TEST_F( CheckPermissionsAllowedWithoutParameters_SetLimitedPermissions_ExpectEmptyListOfAllowedParams) { // Arrange const std::string query = - "INSERT OR REPLACE INTO `application` (`id`, `memory_kb`," - " `heart_beat_timeout_ms`) VALUES ('12345', 5, 10); " + "INSERT OR REPLACE INTO `application` (`id`, " + " `heart_beat_timeout_ms`) VALUES ('12345', 10); " "INSERT OR REPLACE INTO functional_group (`id`, `name`)" " VALUES (1, 'Base-4'); " "INSERT OR REPLACE INTO `app_group` (`application_id`," @@ -1050,10 +1048,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, " "0, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default)); @@ -1062,10 +1060,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'pre_DataConsent', 0, 0, 'NONE', " "'NONE', 0, 0, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_predataconsent)); @@ -1074,10 +1072,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', " "'COMMUNICATION', 0, 0, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_device)); @@ -1086,10 +1084,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', " "0, 0, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_12345)); @@ -1146,10 +1144,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, " "0, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default)); @@ -1158,10 +1156,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'pre_DataConsent', 0, 0, 'NONE', " "'NONE', 0, 0, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_predataconsent)); @@ -1170,10 +1168,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', " "'COMMUNICATION', 0, 0, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_device)); @@ -1182,10 +1180,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', " "0, 0, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_12345)); @@ -1361,10 +1359,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, " "0, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default)); @@ -1373,9 +1371,9 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', " - "'COMMUNICATION', 0, 0, 0, 64, 10) "; + "'COMMUNICATION', 0, 0, 0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_device)); @@ -1384,10 +1382,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', " "0, 0, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_12345)); @@ -1406,10 +1404,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '7777', 0, 0, 'NONE', 'NONE', 1, " "0, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_7777)); @@ -1418,10 +1416,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', " "0, 0, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_12345)); @@ -1438,10 +1436,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, " "1, " - "0, 64, 10) "; + "0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default)); @@ -1450,9 +1448,9 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '123', 1, 0, 'FULL', " - "'COMMUNICATION', 1, 1, 0, 64, 10) "; + "'COMMUNICATION', 1, 1, 0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_123)); @@ -1487,10 +1485,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, " "0, " - "1, 64, 10) "; + "1, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app)); @@ -1505,8 +1503,8 @@ TEST_F(SQLPTRepresentationTest, const std::string query_insert_app = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, " - "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) " - "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 1, 0, 64, 10) "; + "`is_default`, `is_predata`, `heart_beat_timeout_ms`) " + "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 1, 0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app)); @@ -1547,10 +1545,10 @@ TEST_F(SQLPTRepresentationTest, "INSERT INTO `application`(`id`, `keep_context`, " "`steal_focus`, " " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, " - "`is_predata`, `memory_kb`, " + "`is_predata`, " " `heart_beat_timeout_ms`) " "VALUES( '" + - kDefaultId + "', 0, 0, 'NONE', 'NONE', 0, 0, 0, 64, 10) "; + kDefaultId + "', 0, 0, 'NONE', 'NONE', 0, 0, 0, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_default_app)); @@ -1574,9 +1572,9 @@ TEST_F(SQLPTRepresentationTest, const std::string query_insert_new_app = "INSERT INTO `application`(`id`, `keep_context`, " "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, " - "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) " + "`is_default`, `is_predata`, `heart_beat_timeout_ms`) " "VALUES('" + - kAppId + "', 0, 0, 'NONE', 'NONE', 0, 0, 1, 64, 10)"; + kAppId + "', 0, 0, 'NONE', 'NONE', 0, 0, 1, 10)"; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_new_app)); @@ -1631,8 +1629,8 @@ TEST_F(SQLPTRepresentationTest, const std::string query_insert_app = "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, " "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, " - "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) " - "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 0, 1, 64, 10) "; + "`is_default`, `is_predata`, `heart_beat_timeout_ms`) " + "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 0, 1, 10) "; // Assert ASSERT_TRUE(query_wrapper_->Exec(query_insert_app)); diff --git a/src/components/resumption/src/last_state_impl.cc b/src/components/resumption/src/last_state_impl.cc index 9920a1499b..45fcdb2e8e 100644 --- a/src/components/resumption/src/last_state_impl.cc +++ b/src/components/resumption/src/last_state_impl.cc @@ -49,7 +49,6 @@ LastStateImpl::LastStateImpl(const std::string& app_storage_folder, LastStateImpl::~LastStateImpl() { SDL_LOG_AUTO_TRACE(); - SaveToFileSystem(); } void LastStateImpl::SaveToFileSystem() { diff --git a/src/components/utils/test/policy.sql b/src/components/utils/test/policy.sql index ed627b5fdc..7eaf572b71 100644 --- a/src/components/utils/test/policy.sql +++ b/src/components/utils/test/policy.sql @@ -117,7 +117,6 @@ BEGIN TRANSACTION; `is_revoked` BOOLEAN, `is_default` BOOLEAN, `is_predata` BOOLEAN, - `memory_kb` INTEGER NOT NULL, `heart_beat_timeout_ms` INTEGER NOT NULL, `certificate` VARCHAR(45), CONSTRAINT `fk_application_hmi_level1` diff --git a/tools/infrastructure/collect_coverage.sh b/tools/infrastructure/collect_coverage.sh index 47559e6c47..498eee7f65 100755 --- a/tools/infrastructure/collect_coverage.sh +++ b/tools/infrastructure/collect_coverage.sh @@ -17,7 +17,7 @@ rm -rf $COVERAGE_DIR rm -rf $REPORTS_DIR - mkdir $COVERAGE_DIR -lcov --quiet --capture --directory . --output-file $COVERAGE_DIR/full_report.info +lcov --quiet --capture --directory $BUILD_DIR --output-file $COVERAGE_DIR/full_report.info lcov --quiet --remove $COVERAGE_DIR/full_report.info '/usr/*' '*/test/*' '*/src/3rd*' '*/build/src/*' --output-file $COVERAGE_DIR/coverage.info mkdir $REPORTS_DIR |