Skip to content

Commit 3bcbae1

Browse files
author
Digital-Larry
authored
Interactive reg script adjustments to double check service name vali… (#118)
* Interactive reg script adjustments to double check serevice name validation * Optimizing run time of interactive test. * Added a variable to control interactive test. * Added an environment vriable to control full (long) interactive test, which adds a number of minutes to test * Yet another tweak on interactive CI test * Added test characters to service names to confirm validation.
1 parent 8d8bebc commit 3bcbae1

File tree

6 files changed

+30
-22
lines changed

6 files changed

+30
-22
lines changed

connectd/usr/bin/connectd_library

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
# Copyright (C) 2019 remot3.it, Inc. All rights reserved.
1010

1111
##### Settings #####
12-
LIBVERSION=lib_v2.1.21
12+
LIBVERSION=lib_v2.1.22
1313
AUTHOR="Gary Worsham"
14-
LIBMODIFIED="June 11, 2019"
14+
LIBMODIFIED="June 17, 2020"
1515
GREPFLAGS=
1616
apikey="remote.it.developertoolsHW9iHnd"
1717

@@ -1111,7 +1111,7 @@ getNewPassword() {
11111111
stty echo
11121112
fi
11131113

1114-
if [ $(validateInput "$password" "\$ \@ \! \- \_ \. [a-zA-Z0-9]") != 0 ]; then
1114+
if [ $(validateInput "$password" "\$ \@ \! \_ \. [a-zA-Z0-9]-") != 0 ]; then
11151115
printf "\nSorry, password contains one or more invalid characters.\n"
11161116
password=""
11171117
passwordOK=-1

scripts/build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# sorts out Lintian errors/warnings into individual
55
# text files
66
pkg=connectd
7-
ver=2.1.13
8-
MODIFIED="June 10, 2020"
7+
ver=2.1.14
8+
MODIFIED="June 17, 2020"
99
SCRIPT_DIR="$(cd $(dirname $0) && pwd)"
1010
TEST_DIR="$SCRIPT_DIR"/../test
1111
pkgFolder="$pkg"
@@ -17,6 +17,7 @@ user=$(whoami)
1717
echo $user
1818
# debugging flag, set to 0 to skip tests
1919
runtests=1
20+
interactive=1
2021

2122
#---------------------------------------------------------------------------------
2223
# add_creds takes the environment variables and puts them into the file
@@ -278,11 +279,13 @@ if [ $? -ne 0 ]; then
278279
exit 1
279280
fi
280281

282+
if [ $interactive -eq 1 ]; then
281283
"$TEST_DIR"/Interactive/full-interactive-test.sh
282284
if [ $? -ne 0 ]; then
283285
echo "Interactive Registration failure!"
284286
exit 1
285287
fi
288+
fi
286289

287290
sudo "$TEST_DIR"/dpkg/dpkg-purge.sh
288291
if [ $? -ne 0 ]; then

test/Interactive/configure-01.key

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
1
2-
SERVICENAME-device
2+
SERVICENAME-_ device
33
1
44
1
55
y
6-
SERVICENAME-ssh
7-
1
8-
2
9-
y
10-
SERVICENAME-web
11-
1
12-
3
13-
y
14-
SERVICENAME-web-secure
6+
SERVICENAME-_ ssh
157
5
168
y

test/Interactive/configure-02.key

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
1
22
1
3+
2
4+
y
5+
SERVICENAME-web
6+
1
7+
3
8+
y
9+
SERVICENAME-SecureWeb
10+
1
311
4
412
n
513
5900

test/Interactive/full-interactive-test.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,19 @@ sed "s/SERVICENAME/$TESTNAME/g" "$SCRIPT_DIR"/configure-01.key > "$SCRIPT_DIR"/c
7878
sed "s/SERVICENAME/$TESTNAME/g" "$SCRIPT_DIR"/configure-02.key > "$SCRIPT_DIR"/configure-02-test.key
7979

8080
#-------------------------------------------------------------------
81-
# run installer for first time, add device name and 3 services
82-
# expected result is that 4 connectd services and 1 schannel service will be running
83-
check_service_counts 4 1 configure-01-test.key
81+
# run installer for first time, add device name and 1 service
82+
# expected result is that 2 connectd services and 1 schannel service will be running
83+
check_service_counts 2 1 configure-01-test.key
8484

8585
#-------------------------------------------------------------------
8686
# run installer for second time, add 6 more services
8787
# expected result is that 9 connectd services and 1 schannel service will be running
88-
check_service_counts 10 1 configure-02-test.key
88+
if [ "$CI_FULL_INTERACTIVE_TEST" = "1" ]; then
89+
COUNT=10
90+
check_service_counts $COUNT 1 configure-02-test.key
91+
else
92+
COUNT=2
93+
fi
8994

9095
# Now use systemd to turn off and then on the connectd and connectd_schannel
9196
# daemons and confirm operation.
@@ -99,10 +104,10 @@ check_service_counts 0 0
99104

100105
sudo systemctl start connectd
101106
sleep 10
102-
check_service_counts 10 0
107+
check_service_counts $COUNT 0
103108
sudo systemctl start connectd_schannel
104109
sleep 5
105-
check_service_counts 10 1
110+
check_service_counts $COUNT 1
106111
#-------------------------------------------------------------------
107112
# run installer for third time, remove all services
108113
# expected result is that 0 connectd services and 0 schannel service will be running

test/Interactive/interactive-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ checkForRoot
99

1010
#-----------------------------------------------------------------------
1111

12-
# it is necessasry to remove the bulk_identification_code.txt file for the following tests to work
12+
# it is necessary to remove the bulk_identification_code.txt file for the following tests to work
1313
# bulk_identification_code.txt is only used by bulk and auto registration
1414
if [ -e /etc/connectd/bulk_identification_code.txt ]; then
1515
echo "Deleting /etc/connectd/bulk_identification_code.txt"

0 commit comments

Comments
 (0)