From b13750d5f0d354ee83fed79ff03224b89dcad23b Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Mon, 6 May 2019 13:06:31 -0400 Subject: [PATCH] Make Mtce system mode scan case in-sensitive Mtce is looking for 'Standard' in system_type and will default to AIO if the 'S' in 'standard' is not uppercase. This update makes the mtce system_type driver handle system_type and system_mode readings case in-sensitive. Tested on-system case variations for both type and mode in platform.conf. Closes-Bug: 1827904 Change-Id: I5e33097e1b13e5b5d385929dd13e7912ae89ead8 Signed-off-by: Eric MacDonald --- mtce-common/src/common/nodeUtil.cpp | 2 +- mtce-common/src/common/nodeUtil.h | 4 ++-- mtce-common/src/daemon/daemon_files.cpp | 7 +++++-- mtce/centos/build_srpm.data | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mtce-common/src/common/nodeUtil.cpp b/mtce-common/src/common/nodeUtil.cpp index 32feecc2..2727158d 100755 --- a/mtce-common/src/common/nodeUtil.cpp +++ b/mtce-common/src/common/nodeUtil.cpp @@ -1472,7 +1472,7 @@ unsigned short checksum(void *b, int len) } -std::string tolowercase ( const std::string & in ) +std::string tolowercase ( const std::string in ) { std::string out; diff --git a/mtce-common/src/common/nodeUtil.h b/mtce-common/src/common/nodeUtil.h index c1f959b7..00a6828b 100755 --- a/mtce-common/src/common/nodeUtil.h +++ b/mtce-common/src/common/nodeUtil.h @@ -2,7 +2,7 @@ #define __INCLUDE_NODEUTIL_H__ /* -* Copyright (c) 2013-2014, 2016 Wind River Systems, Inc. +* Copyright (c) 2013-2014, 2016, 2019 Wind River Systems, Inc. * * SPDX-License-Identifier: Apache-2.0 * @@ -104,7 +104,7 @@ string lltos (long long unsigned int val ); string ftos ( float val, int resolution ); unsigned short checksum(void *b, int len); -std::string tolowercase ( const std::string & in ); +std::string tolowercase ( const std::string in ); int get_delimited_list ( string str , char delimiter, list & the_list, bool remove_whitespace ); diff --git a/mtce-common/src/daemon/daemon_files.cpp b/mtce-common/src/daemon/daemon_files.cpp index 6ad20a2b..5d86af03 100755 --- a/mtce-common/src/daemon/daemon_files.cpp +++ b/mtce-common/src/daemon/daemon_files.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 Wind River Systems, Inc. + * Copyright (c) 2013-2019 Wind River Systems, Inc. * * SPDX-License-Identifier: Apache-2.0 * @@ -32,6 +32,7 @@ using namespace std; #include "daemon_common.h" #include "daemon_option.h" #include "nodeBase.h" +#include "nodeUtil.h" /* GNU Extension * program_invocation_name contains the name that was used to invoke the @@ -365,7 +366,8 @@ system_type_enum daemon_system_type ( void ) if ( sscanf ( &buffer[0], "system_type=%1023s", &type_str[0] ) == 1 ) { string type_string = type_str ; - if ( !type_string.empty() && ( type_string == "Standard")) + type_string = tolowercase(type_string); + if ( !type_string.empty() && ( type_string == "standard")) { system_type = SYSTEM_TYPE__NORMAL ; } @@ -400,6 +402,7 @@ system_type_enum daemon_system_type ( void ) if ( sscanf ( &buffer[0], "system_mode=%1023s", &mode_str[0] ) == 1 ) { string mode = mode_str ; + mode = tolowercase(mode); if ( !mode.empty() ) { if ( mode.compare("duplex") == 0 ) diff --git a/mtce/centos/build_srpm.data b/mtce/centos/build_srpm.data index 93ff831d..86474af5 100644 --- a/mtce/centos/build_srpm.data +++ b/mtce/centos/build_srpm.data @@ -1,3 +1,3 @@ SRC_DIR="src" -TIS_PATCH_VER=149 +TIS_PATCH_VER=150 BUILD_IS_SLOW=5