* [dts] [PATCH v1] framework dut: optimize session name
@ 2017-07-26 5:40 Marvin Liu
0 siblings, 0 replies; only message in thread
From: Marvin Liu @ 2017-07-26 5:40 UTC (permalink / raw)
To: dts; +Cc: Marvin Liu
If session is created with specified name, session name will use it.
Signed-off-by: Marvin Liu <yong.liu@intel.com>
diff --git a/framework/dut.py b/framework/dut.py
index ddbe64e..ad0d250 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -91,13 +91,19 @@ class Dut(Crb):
"""
Create new session for dut instance. Session name will be unique.
"""
- session_name = self.NAME + '_' + str(uuid4())
+ if len(suite):
+ session_name = self.NAME + '_' + suite
+ else:
+ session_name = self.NAME + '_' + str(uuid4())
session = self.create_session(name=session_name)
if suite != "":
session.logger.config_suite(suite, self.NAME)
else:
session.logger.config_execution(self.NAME)
- session.send_expect("cd %s" % self.base_dir, "# ")
+
+ if getattr(self, "base_dir", None):
+ session.send_expect("cd %s" % self.base_dir, "# ")
+
return session
def close_session(self, session):
--
1.9.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-26 5:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26 5:40 [dts] [PATCH v1] framework dut: optimize session name Marvin Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).