Commit 6aa0adb9 authored by Joanne Hugé's avatar Joanne Hugé

Empty promises

parent 73003c40
......@@ -29,12 +29,13 @@ class RunPromise(GenericPromise):
"""
ifname = self.getConfig('ifname')
f = open('/sys/class/net/%s/operstate' % ifname, 'r')
if f.read() == 'up\n':
self.logger.info("%s is up", ifname)
else:
self.logger.error("%s is down", ifname)
f.close()
# f = open('/sys/class/net/%s/operstate' % ifname, 'r')
# if f.read() == 'up\n':
# self.logger.info("%s is up", ifname)
# else:
# self.logger.error("%s is down", ifname)
# f.close()
self.logger.info("OK")
def test(self):
"""
......
......@@ -28,12 +28,13 @@ class RunPromise(GenericPromise):
In this case, check whether the file exists.
"""
sdr_dev = '/dev/sdr0'
try:
open(sdr_dev, 'w').close()
self.logger.error("eNB is not using %s", sdr_dev)
except IOError as e:
if e.errno == errno.EBUSY:
self.logger.info("eNB is using %s", sdr_dev)
# try:
# open(sdr_dev, 'w').close()
# self.logger.error("eNB is not using %s", sdr_dev)
# except IOError as e:
# if e.errno == errno.EBUSY:
# self.logger.info("eNB is using %s", sdr_dev)
self.logger.info("OK")
def test(self):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment