Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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-RAN
Commits
87dccea4
Commit
87dccea4
authored
Jul 20, 2020
by
hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integrating cots ue control into CI
parent
331c74af
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
135 additions
and
0 deletions
+135
-0
ci-scripts/cls_cots_ue.py
ci-scripts/cls_cots_ue.py
+89
-0
ci-scripts/main.py
ci-scripts/main.py
+7
-0
ci-scripts/xml_files/fr1_toggle_cots_ue.xml
ci-scripts/xml_files/fr1_toggle_cots_ue.xml
+39
-0
No files found.
ci-scripts/cls_cots_ue.py
0 → 100644
View file @
87dccea4
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
# Python for CI of OAI-eNB + COTS-UE
#
# Required Python Version
# Python 3.x
#
# Required Python Package
# pexpect
#---------------------------------------------------------------------
#to use logging.info()
import
logging
#to create a SSH object locally in the methods
import
sshconnection
class
CotsUe
:
def
__init__
(
self
,
model
,
UEIPAddr
,
UEUserName
,
UEPassWord
):
self
.
model
=
model
self
.
UEIPAddr
=
UEIPAddr
self
.
UEUserName
=
UEUserName
self
.
UEPassWord
=
UEPassWord
self
.
runargs
=
''
#on of off to toggle airplane mode on/off
self
.
__SetAirplaneRetry
=
3
#-----------------$
#PUBLIC Methods$
#-----------------$
def
Check_Airplane
(
self
):
mySSH
=
sshconnection
.
SSHConnection
()
mySSH
.
open
(
self
.
UEIPAddr
,
self
.
UEUserName
,
self
.
UEPassWord
)
mySSH
.
command
(
'cd /home/oaici/remi/android-sdk-linux/platform-tools'
,
'\$'
,
5
)
status
=
mySSH
.
cde_check_value
(
'sudo ./adb shell settings get global airplane_mode_on '
,
[
'0'
,
'1'
],
5
)
mySSH
.
close
()
return
status
def
Set_Airplane
(
self
,
target_state_str
):
print
(
"toggling state to : "
+
target_state_str
)
current_state
=
self
.
Check_Airplane
()
if
target_state_str
.
lower
()
==
"on"
:
target_state
=
1
else
:
target_state
=
0
if
current_state
!=
target_state
:
#toggle state
mySSH
=
sshconnection
.
SSHConnection
()
mySSH
.
open
(
self
.
UEIPAddr
,
self
.
UEUserName
,
self
.
UEPassWord
)
retry
=
0
while
(
current_state
!=
target_state
)
and
(
retry
<
self
.
__SetAirplaneRetry
):
mySSH
.
command
(
'cd /home/oaici/remi/android-sdk-linux/platform-tools'
,
'\$'
,
5
)
mySSH
.
command
(
'sudo ./adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS'
,
'\$'
,
5
)
mySSH
.
command
(
'sudo ./adb shell input keyevent 20'
,
'\$'
,
5
)
mySSH
.
command
(
'sudo ./adb shell input tap 968 324'
,
'\$'
,
5
)
time
.
sleep
(
1
)
current_state
=
self
.
Check_Airplane
()
retry
+=
1
if
current_state
!=
target_state
:
print
(
"ATTENTION : Could not toggle to : "
+
target_state_str
)
print
(
"Current state is : "
+
str
(
current_state
))
mySSH
.
close
()
else
:
print
(
"Airplane mode is already "
+
target_state_str
)
ci-scripts/main.py
View file @
87dccea4
...
@@ -3237,6 +3237,10 @@ def GetParametersFromXML(action):
...
@@ -3237,6 +3237,10 @@ def GetParametersFromXML(action):
if
action
==
'Run_PhySim'
:
if
action
==
'Run_PhySim'
:
ldpc
.
runargs
=
test
.
findtext
(
'physim_run_args'
)
ldpc
.
runargs
=
test
.
findtext
(
'physim_run_args'
)
if
action
==
'COTS_UE_Airplane'
:
COTS_UE
=
CotsUe
(
'oppo'
,
self
.
UEIPAddress
,
self
.
UEUserName
,
UEPassword
)
COTS_UE
.
runargs
=
test
.
findtext
(
'cots_ue_airplane_args'
)
#check if given test is in list
#check if given test is in list
#it is in list if one of the strings in 'list' is at the beginning of 'test'
#it is in list if one of the strings in 'list' is at the beginning of 'test'
def
test_in_list
(
test
,
list
):
def
test_in_list
(
test
,
list
):
...
@@ -3274,6 +3278,9 @@ RAN.EpcObj=EPC
...
@@ -3274,6 +3278,9 @@ RAN.EpcObj=EPC
import
cls_physim
#class PhySim for physical simulators build and test
import
cls_physim
#class PhySim for physical simulators build and test
ldpc
=
cls_physim
.
PhySim
()
#create an instance for LDPC test using GPU or CPU build
ldpc
=
cls_physim
.
PhySim
()
#create an instance for LDPC test using GPU or CPU build
import
cls_cots_ue
#class CotsUe
argvs
=
sys
.
argv
argvs
=
sys
.
argv
argc
=
len
(
argvs
)
argc
=
len
(
argvs
)
cwd
=
os
.
getcwd
()
cwd
=
os
.
getcwd
()
...
...
ci-scripts/xml_files/fr1_toggle_cots_ue.xml
0 → 100644
View file @
87dccea4
<!--
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
-->
<testCaseList>
<htmlTabRef>
test-toggle-airplane-mode
</htmlTabRef>
<htmlTabName>
Airplane
</htmlTabName>
<htmlTabIcon>
tasks
</htmlTabIcon>
<TestCaseRequestedList>
010101
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase
id=
"010101"
>
<class>
COTS_UE_Airplane
</class>
<desc>
toggle on
</desc>
<cots_ue_airplane_args>
ON
</cots_ue_airplane_args>
</testCase>
</testCaseList>
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