test_configsnap.py
def func2_customtag(self):
        """Customised tag; -t command line option"""
        test = self.whoami()
        o = self.run_command('./configsnap -t randomalternativetag')
        if o.retcode != 0:
            self.failtest(test, "Exit code non-zero")
        else:
            print("%s PASS Exit code zero" % test)

        # Check tag name on dir
        if os.path.exists('/root/randomalternativetag'):
            print("%s PASS alternative tag dir exists" % test)
        else:
            self.failtest(test, "Alternative tag dir doesn't exist")

        if len(os.listdir('/root/randomalternativetag/configsnap')) < 1:
            self.failtest(test, "No files in collection dir")
        else:
            print("%s PASS Files in collection dir" % test)
Customised tag; -t command line option
Customised tag; -t command line option
Customised tag ; - t command line option
def func2_customtag(self):
        test = self.whoami()
        o = self.run_command('./configsnap -t randomalternativetag')
        if o.retcode != 0:
            self.failtest(test, "Exit code non-zero")
        else:
            print("%s PASS Exit code zero" % test)
        if os.path.exists('/root/randomalternativetag'):
            print("%s PASS alternative tag dir exists" % test)
        else:
            self.failtest(test, "Alternative tag dir doesn't exist")
        if len(os.listdir('/root/randomalternativetag/configsnap')) < 1:
            self.failtest(test, "No files in collection dir")
        else:
            print("%s PASS Files in collection dir" % test)
def func2_customtag ( self ) : test = self . whoami ( ) o = self . run_command ( './configsnap -t randomalternativetag' ) if o . retcode != 0 : self . failtest ( test , "Exit code non-zero" ) else : print ( "%s PASS Exit code zero" % test ) if os . path . exists ( '/root/randomalternativetag' ) : print ( "%s PASS alternative tag dir exists" % test ) else : self . failtest ( test , "Alternative tag dir doesn't exist" ) if len ( os . listdir ( '/root/randomalternativetag/configsnap' ) ) < 1 : self . failtest ( test , "No files in collection dir" ) else : print ( "%s PASS Files in collection dir" % test )
Customised tag; -t command line option
Customised tag ; - t command line option
"""Customised tag; -t command line option""" # Check tag name on dir
self