From 971ab65fe5196fb9a979d12c0e3d23e17cf5d328 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 31 May 2024 07:50:23 +0200 Subject: [PATCH] Physims don't need sudo --- cmake_targets/autotests/run_exec_autotests.bash | 12 ------------ cmake_targets/build_oai | 11 ++--------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/cmake_targets/autotests/run_exec_autotests.bash b/cmake_targets/autotests/run_exec_autotests.bash index 0b8c86795e..c531f62f9a 100755 --- a/cmake_targets/autotests/run_exec_autotests.bash +++ b/cmake_targets/autotests/run_exec_autotests.bash @@ -30,7 +30,6 @@ fi source $OPENAIR_DIR/cmake_targets/tools/test_helper -SUDO="sudo -E" tdir=$OPENAIR_DIR/cmake_targets/autotests rm -fr $tdir/bin mkdir -p $tdir/bin @@ -178,8 +177,6 @@ RUN_GROUP=0 test_case_group="" test_case_group_array=() test_case_array=() -echo_info "Note that the user should be sudoer for executing certain commands, for example loading kernel modules" - until [ -z "$1" ]; do case "$1" in @@ -207,15 +204,6 @@ until [ -z "$1" ]; do esac done -tmpfile=`mktemp` -$SUDO echo $HOME > $tmpfile -tstsudo=`cat $tmpfile` -if [ "$tstsudo" != "$HOME" ]; then - echo_error "$USER does not have sudo privileges. Exiting" - exit -fi -rm -fr $tmpfile - test_case_excl_list=`xmlstarlet sel -t -v "/testCaseList/TestCaseExclusionList" $xml_conf` test_case_excl_list=`sed "s/\+/\*/g" <<< "$test_case_excl_list" ` # Replace + with * for bash string substituion echo "Test Case Exclusion List = $test_case_excl_list " diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index c59017b5ac..beb1b51039 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -542,22 +542,15 @@ function main() { # Auto-tests # ############## if [ "$OAI_TEST" = "1" ] ; then - echo_error "These scripts ASSUME that user is in /etc/sudoers and can execute commands without PASSWORD prompt" - echo_error "Add the following lines in /etc/sudoers file to make your __user_name__ sudo without password prompt" - echo_error " __your_user_name__ ALL = (ALL:ALL) NOPASSWD: ALL" - echo_error " __your_user_name__ ALL = (ALL) NOPASSWD: ALL " echo_info "The log file for the autotest script for debugging is located here: $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log " echo_info "The results of autotests results is located here: $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml " echo_info "You can hit CTRL-C at any time to terminate the autotests..." - echo "Current User Name: $USER" - read -s -p "Enter Password: " mypassword - echo -e "\n" rm -fr $OPENAIR_DIR/cmake_targets/autotests/log mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log if [ "$RUN_GROUP" -eq "1" ]; then - $OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -g "$TEST_CASE_GROUP" -p $mypassword >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log & + $OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -g "$TEST_CASE_GROUP" >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log else - $OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -p $mypassword >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log & + $OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log fi wait else