Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG UE
Commits
2a98b6c0
Commit
2a98b6c0
authored
Aug 21, 2020
by
hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing typos + more in-code comments
parent
b1804811
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
ci-scripts/cls_cots_ue.py
ci-scripts/cls_cots_ue.py
+6
-2
No files found.
ci-scripts/cls_cots_ue.py
View file @
2a98b6c0
...
@@ -62,11 +62,13 @@ class CotsUe:
...
@@ -62,11 +62,13 @@ class CotsUe:
#load cots commands dictionary
#load cots commands dictionary
with
open
(
self
.
__cots_cde_dict_file
,
'r'
)
as
file
:
with
open
(
self
.
__cots_cde_dict_file
,
'r'
)
as
file
:
cots_ue_ctl
=
yaml
.
load
(
file
,
Loader
=
yaml
.
FullLoader
)
cots_ue_ctl
=
yaml
.
load
(
file
,
Loader
=
yaml
.
FullLoader
)
#check if ue id is in the dictionary
if
target_id
in
cots_ue_ctl
:
if
target_id
in
cots_ue_ctl
:
mySSH
=
sshconnection
.
SSHConnection
()
mySSH
=
sshconnection
.
SSHConnection
()
mySSH
.
open
(
self
.
ADBIPAddr
,
self
.
ADBUserName
,
self
.
ADBPassWord
)
mySSH
.
open
(
self
.
ADBIPAddr
,
self
.
ADBUserName
,
self
.
ADBPassWord
)
mySSH
.
command
(
'sudo adb start-server'
,
'$'
,
5
)
mySSH
.
command
(
'sudo adb start-server'
,
'
\
$'
,
5
)
logging
.
info
(
"Toggling COTS UE Airplane mode to : "
+
target_state_str
)
logging
.
info
(
"Toggling COTS UE Airplane mode to : "
+
target_state_str
)
#get current state
current_state
=
self
.
Check_Airplane
()
current_state
=
self
.
Check_Airplane
()
if
target_state_str
.
lower
()
==
"on"
:
if
target_state_str
.
lower
()
==
"on"
:
target_state
=
1
target_state
=
1
...
@@ -82,13 +84,15 @@ class CotsUe:
...
@@ -82,13 +84,15 @@ class CotsUe:
time
.
sleep
(
1
)
time
.
sleep
(
1
)
current_state
=
self
.
Check_Airplane
()
current_state
=
self
.
Check_Airplane
()
retry
+=
1
retry
+=
1
#could not toggle despite the retry
if
current_state
!=
target_state
:
if
current_state
!=
target_state
:
logging
.
error
(
"ATTENTION : Could not toggle to : "
+
target_state_str
)
logging
.
error
(
"ATTENTION : Could not toggle to : "
+
target_state_str
)
logging
.
error
(
"Current state is : "
+
str
(
current_state
))
logging
.
error
(
"Current state is : "
+
str
(
current_state
))
else
:
else
:
print
(
"Airplane mode is already "
+
target_state_str
)
print
(
"Airplane mode is already "
+
target_state_str
)
mySSH
.
command
(
'sudo adb kill-server'
,
'$'
,
5
)
mySSH
.
command
(
'sudo adb kill-server'
,
'
\
$'
,
5
)
mySSH
.
close
()
mySSH
.
close
()
#ue id is NOT in the dictionary
else
:
else
:
logging
.
error
(
"COTS UE Id from XML could not be found in UE YAML dictionary "
+
self
.
__cots_cde_dict_file
)
logging
.
error
(
"COTS UE Id from XML could not be found in UE YAML dictionary "
+
self
.
__cots_cde_dict_file
)
sys
.
exit
(
"COTS UE Id from XML could not be found in UE YAML dictionary "
+
self
.
__cots_cde_dict_file
)
sys
.
exit
(
"COTS UE Id from XML could not be found in UE YAML dictionary "
+
self
.
__cots_cde_dict_file
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment