@@ -66,12 +66,18 @@ def setUp(self):
6666 self .load_config ()
6767 if self .do_validate_pci_device :
6868 self .validate_pci_device ()
69+ print (f"\n setup: ctrl: { self .ctrl } , ns1: { self .ns1 } , default_nsid: { self .default_nsid } , flbas: { self .flbas } \n " )
6970
7071 def tearDown (self ):
7172 """ Post Section for TestNVMe. """
7273 if self .clear_log_dir is True :
7374 shutil .rmtree (self .log_dir , ignore_errors = True )
7475 self .create_and_attach_default_ns ()
76+ print (f"\n teardown: ctrl: { self .ctrl } , ns1: { self .ns1 } , default_nsid: { self .default_nsid } , flbas: { self .flbas } \n " )
77+
78+ @classmethod
79+ def tearDownClass (cls ):
80+ print ("\n " )
7581
7682 def create_and_attach_default_ns (self ):
7783 """ Creates a default namespace with the full capacity of the ctrls NVM
@@ -104,8 +110,8 @@ def validate_pci_device(self):
104110 - None
105111 """
106112 x1 , x2 , dev = self .ctrl .split ('/' )
107- cmd = cmd = "find /sys/devices -name \\ *" + dev + " | grep -i pci"
108- err = subprocess .call (cmd , shell = True )
113+ cmd = "find /sys/devices -name \\ *" + dev + " | grep -i pci"
114+ err = subprocess .call (cmd , shell = True , stdout = subprocess . DEVNULL )
109115 self .assertEqual (err , 0 , "ERROR : Only NVMe PCI subsystem is supported" )
110116
111117 def load_config (self ):
@@ -452,15 +458,12 @@ def get_smart_log(self, nsid):
452458 """
453459 smart_log_cmd = f"{ self .nvme_bin } smart-log { self .ctrl } " + \
454460 f"--namespace-id={ str (nsid )} "
455- print (smart_log_cmd )
456461 proc = subprocess .Popen (smart_log_cmd ,
457462 shell = True ,
458463 stdout = subprocess .PIPE ,
459464 encoding = 'utf-8' )
460465 err = proc .wait ()
461466 self .assertEqual (err , 0 , "ERROR : nvme smart log failed" )
462- smart_log_output = proc .communicate ()[0 ]
463- print (f"{ smart_log_output } " )
464467 return err
465468
466469 def get_id_ctrl (self , vendor = False ):
@@ -475,7 +478,6 @@ def get_id_ctrl(self, vendor=False):
475478 else :
476479 id_ctrl_cmd = f"{ self .nvme_bin } id-ctrl " + \
477480 f"--vendor-specific { self .ctrl } "
478- print (id_ctrl_cmd )
479481 proc = subprocess .Popen (id_ctrl_cmd ,
480482 shell = True ,
481483 stdout = subprocess .PIPE ,
@@ -521,14 +523,14 @@ def run_ns_io(self, nsid, lbads, count=10):
521523 ns_path = self .ctrl + "n" + str (nsid )
522524 io_cmd = "dd if=" + ns_path + " of=/dev/null" + " bs=" + \
523525 str (block_size ) + " count=" + str (count ) + " > /dev/null 2>&1"
524- print (io_cmd )
526+ print (f"Running io: { io_cmd } " )
525527 run_io = subprocess .Popen (io_cmd , shell = True , stdout = subprocess .PIPE ,
526528 encoding = 'utf-8' )
527529 run_io_result = run_io .communicate ()[1 ]
528530 self .assertEqual (run_io_result , None )
529531 io_cmd = "dd if=/dev/zero of=" + ns_path + " bs=" + \
530532 str (block_size ) + " count=" + str (count ) + " > /dev/null 2>&1"
531- print (io_cmd )
533+ print (f"Running io: { io_cmd } " )
532534 run_io = subprocess .Popen (io_cmd , shell = True , stdout = subprocess .PIPE ,
533535 encoding = 'utf-8' )
534536 run_io_result = run_io .communicate ()[1 ]
0 commit comments