Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv RS485 OPT RTM
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv RS485 OPT RTM
Commits
d18731bd
Commit
d18731bd
authored
Mar 07, 2019
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add scripts to switch on and off the DUT FEC
parent
647571b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
0 deletions
+108
-0
dut-fec-off.py
pts/dut-fec-off.py
+54
-0
dut-fec-on.py
pts/dut-fec-on.py
+54
-0
No files found.
pts/dut-fec-off.py
0 → 100755
View file @
d18731bd
#!/usr/bin/env python
################################################################################
## CERN BE-CO-HT
## CONV-RS485-OPT-RTM
## https://www.ohwr.org/projects/conv-rs485-opt-rtm
################################################################################
##
## unit name: dut-fec-off.py
##
## description: Script to switch OFF the DUT FEC ELMA crate
##
################################################################################
## Copyright CERN 2019
################################################################################
##
## This program is free software: you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free Software
## Foundation, either version 3 of the License, or (at your option) any later
## version.
##
## This program is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
## details.
##
## You should have received a copy of the GNU General Public License along with
## this program. If not, see <https://www.gnu.org/licenses/>.
##
## SPDX-License-Identifier: GPL-3.0-or-later
################################################################################
import
os
import
sys
import
time
import
configparser
config
=
configparser
.
ConfigParser
()
config
.
read
(
'CONFIG.ini'
)
ip
=
config
[
'DUT.FEC'
][
'MgtHostName'
]
pwrd
=
config
[
'DUT.FEC'
][
'MgtPassword'
]
# Turn off DUT.FEC
fd
=
os
.
popen
(
"snmpset -v2c -c
%
s
%
s 1.3.6.1.4.1.37968.1.1.7.2.1.3.1 i 1"
%
(
pwrd
,
ip
))
ret
=
fd
.
close
()
if
(
ret
!=
None
):
print
"ERROR accessing DUT.FEC over SNMP, exiting..."
sys
.
exit
(
ret
>>
8
)
time
.
sleep
(
2
)
print
print
"---------------"
print
print
"DUT FEC cfvm-774-opt-pts2 is OFF now"
pts/dut-fec-on.py
0 → 100755
View file @
d18731bd
#!/usr/bin/env python
################################################################################
## CERN BE-CO-HT
## CONV-RS485-OPT-RTM
## https://www.ohwr.org/projects/conv-rs485-opt-rtm
################################################################################
##
## unit name: dut-fec-on.py
##
## description: Script to switch ON the DUT FEC ELMA crate
##
################################################################################
## Copyright CERN 2019
################################################################################
##
## This program is free software: you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free Software
## Foundation, either version 3 of the License, or (at your option) any later
## version.
##
## This program is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
## details.
##
## You should have received a copy of the GNU General Public License along with
## this program. If not, see <https://www.gnu.org/licenses/>.
##
## SPDX-License-Identifier: GPL-3.0-or-later
################################################################################
import
os
import
sys
import
time
import
configparser
config
=
configparser
.
ConfigParser
()
config
.
read
(
'CONFIG.ini'
)
ip
=
config
[
'DUT.FEC'
][
'MgtHostName'
]
pwrd
=
config
[
'DUT.FEC'
][
'MgtPassword'
]
# Turn on DUT.FEC
fd
=
os
.
popen
(
"snmpset -v2c -c
%
s
%
s 1.3.6.1.4.1.37968.1.1.7.2.1.3.1 i 0"
%
(
pwrd
,
ip
))
ret
=
fd
.
close
()
if
(
ret
!=
None
):
print
"ERROR accessing DUT.FEC over SNMP, exiting..."
sys
.
exit
(
ret
>>
8
)
time
.
sleep
(
2
)
print
print
"---------------"
print
print
"DUT FEC cfvm-774-opt-pts2 is ON now"
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