[svn r683] More test configuration options. trunk
authorrosfran
Wed May 16 23:21:58 2007 +0100 (2007-05-16)
branchtrunk
changeset 6771b7b4d7f714c
parent 676 b51559fec601
child 678 89bdaa9e72bf
[svn r683] More test configuration options.
gmyth/tests/test_connection.py
gmyth/tests/test_file_download.py
gmyth/tests/test_filelocal.py
gmyth/tests/test_filetransfer.py
gmyth/tests/test_livetv.py
gmyth/tests/test_livetv_stress.py
gmyth/tests/test_main.py
gmyth/tests/test_monitor_handler.py
gmyth/tests/test_program_info.py
gmyth/tests/test_recorder.py
gmyth/tests/test_recordings.py
gmyth/tests/utils.py
     1.1 --- a/gmyth/tests/test_connection.py	Wed May 16 21:56:47 2007 +0100
     1.2 +++ b/gmyth/tests/test_connection.py	Wed May 16 23:21:58 2007 +0100
     1.3 @@ -8,6 +8,7 @@
     1.4  
     1.5  cfg_file = TestConfigFile('test_scripts.cfg')
     1.6  
     1.7 -p = start('gmyth_test_connection', ["myth://%s:%s/livetv?channel=1" % (cfg_file.get_host(), cfg_file.get_port())], 2)
     1.8 +p = start('gmyth_test_connection', ["myth://%s:%s/livetv?channel=%s" % (cfg_file.get_host(), \
     1.9 +	cfg_file.get_port(), cfg_file.get_tv_channel())], 2)
    1.10  
    1.11  sys.exit(finish(p))
     2.1 --- a/gmyth/tests/test_file_download.py	Wed May 16 21:56:47 2007 +0100
     2.2 +++ b/gmyth/tests/test_file_download.py	Wed May 16 23:21:58 2007 +0100
     2.3 @@ -8,7 +8,8 @@
     2.4  
     2.5  cfg_file = TestConfigFile('test_scripts.cfg')
     2.6  
     2.7 -p = start('gmyth_test_file_download', ["myth://%s:%s/1000_20070330144500.nuv" % (cfg_file.get_host(), cfg_file.get_port())], 2)
     2.8 +p = start('gmyth_test_file_download', ["myth://%s:%s/%s" % (cfg_file.get_host(), cfg_file.get_port(), \
     2.9 +        cfg_file.get_filename())], 2)
    2.10  
    2.11  sys.exit(finish(p))
    2.12  
     3.1 --- a/gmyth/tests/test_filelocal.py	Wed May 16 21:56:47 2007 +0100
     3.2 +++ b/gmyth/tests/test_filelocal.py	Wed May 16 23:21:58 2007 +0100
     3.3 @@ -8,6 +8,7 @@
     3.4  
     3.5  cfg_file = TestConfigFile('test_scripts.cfg')
     3.6  
     3.7 -p = start('gmyth_test_filelocal', ["myth://%s:%s/1000_20070330144500.nuv" % (cfg_file.get_host(), cfg_file.get_port())], 2)
     3.8 +p = start('gmyth_test_filelocal', ["myth://%s:%s/%s" % (cfg_file.get_host(), cfg_file.get_port(), \
     3.9 +        cfg_file.get_filename())], 2)
    3.10  
    3.11  sys.exit(finish(p))
     4.1 --- a/gmyth/tests/test_filetransfer.py	Wed May 16 21:56:47 2007 +0100
     4.2 +++ b/gmyth/tests/test_filetransfer.py	Wed May 16 23:21:58 2007 +0100
     4.3 @@ -8,7 +8,8 @@
     4.4  
     4.5  cfg_file = TestConfigFile('test_scripts.cfg')
     4.6  
     4.7 -p = start('gmyth_test_filetransfer', ["myth://%s:%s/1000_20070330144500.nuv" % (cfg_file.get_host(), cfg_file.get_port())], 2)
     4.8 +p = start('gmyth_test_filetransfer', ["myth://%s:%s/%s" % (cfg_file.get_host(), cfg_file.get_port(), \
     4.9 +        cfg_file.get_filename())], 2)
    4.10  
    4.11  sys.exit(finish(p))
    4.12  
     5.1 --- a/gmyth/tests/test_livetv.py	Wed May 16 21:56:47 2007 +0100
     5.2 +++ b/gmyth/tests/test_livetv.py	Wed May 16 23:21:58 2007 +0100
     5.3 @@ -8,14 +8,7 @@
     5.4  
     5.5  cfg_file = TestConfigFile('test_scripts.cfg')
     5.6  
     5.7 -p = start('gmyth_test_livetv', ["myth://%s:%s/livetv?channel=1" % (cfg_file.get_host(), cfg_file.get_port())], 2)
     5.8 -
     5.9 -finish(p)
    5.10 -
    5.11 -p = start('gmyth_test_livetv', ["myth://%s:%s/livetv?channel=1" % (cfg_file.get_host(), cfg_file.get_port())], 2)
    5.12 -
    5.13 -finish(p)
    5.14 -
    5.15 -p = start('gmyth_test_livetv', ['myth://%s:%s/livetv?channel=1' % (cfg_file.get_host(), cfg_file.get_port())], 2)
    5.16 +p = start('gmyth_test_livetv', ["myth://%s:%s/livetv?channel=%s" % (cfg_file.get_host(), \
    5.17 +        cfg_file.get_port(), cfg_file.get_tv_channel())], 2)
    5.18  
    5.19  sys.exit(finish(p))
     6.1 --- a/gmyth/tests/test_livetv_stress.py	Wed May 16 21:56:47 2007 +0100
     6.2 +++ b/gmyth/tests/test_livetv_stress.py	Wed May 16 23:21:58 2007 +0100
     6.3 @@ -8,14 +8,17 @@
     6.4  
     6.5  cfg_file = TestConfigFile('test_scripts.cfg')
     6.6  
     6.7 -p = start('gmyth_test_livetv', ["myth://%s:%s/livetv?channel=1" % (cfg_file.get_host(), cfg_file.get_port())], 2)
     6.8 +p = start('gmyth_test_livetv', ["myth://%s:%s/livetv?channel=%s" % (cfg_file.get_host(), \
     6.9 +        cfg_file.get_port(), cfg_file.get_tv_channel())], 2)
    6.10  
    6.11  finish(p)
    6.12  
    6.13 -p = start('gmyth_test_livetv', ["myth://%s:%s/livetv?channel=1" % (cfg_file.get_host(), cfg_file.get_port())], 2)
    6.14 +p = start('gmyth_test_livetv', ["myth://%s:%s/livetv?channel=%s" % (cfg_file.get_host(), \
    6.15 +        cfg_file.get_port(), cfg_file.get_tv_channel())], 2)
    6.16  
    6.17  finish(p)
    6.18  
    6.19 -p = start('gmyth_test_livetv', ['myth://%s:%s/livetv?channel=1' % (cfg_file.get_host(), cfg_file.get_port())], 2)
    6.20 -
    6.21 +p = start('gmyth_test_livetv', ["myth://%s:%s/livetv?channel=%s" % (cfg_file.get_host(), \
    6.22 +        cfg_file.get_port(), cfg_file.get_tv_channel())], 2)
    6.23 + 
    6.24  sys.exit(finish(p))
     7.1 --- a/gmyth/tests/test_main.py	Wed May 16 21:56:47 2007 +0100
     7.2 +++ b/gmyth/tests/test_main.py	Wed May 16 23:21:58 2007 +0100
     7.3 @@ -8,6 +8,7 @@
     7.4  
     7.5  cfg_file = TestConfigFile('test_scripts.cfg')
     7.6  
     7.7 -p = start('test', ["myth://%s:%s/1000_20070330144500.nuv" % (cfg_file.get_host(), cfg_file.get_port())], 2)
     7.8 +p = start('test', ["myth://%s:%s/%s" % (cfg_file.get_host(), cfg_file.get_port(), \
     7.9 +	cfg_file.get_filename())], 2)
    7.10  
    7.11  sys.exit(finish(p))
     8.1 --- a/gmyth/tests/test_monitor_handler.py	Wed May 16 21:56:47 2007 +0100
     8.2 +++ b/gmyth/tests/test_monitor_handler.py	Wed May 16 23:21:58 2007 +0100
     8.3 @@ -8,14 +8,7 @@
     8.4  
     8.5  cfg_file = TestConfigFile('test_scripts.cfg')
     8.6  
     8.7 -p = start('gmyth_test_monitor_handler', ["myth://%s:%s/livetv?channel=1" % (cfg_file.get_host(), cfg_file.get_port())], 2)
     8.8 -
     8.9 -finish(p)
    8.10 -
    8.11 -p = start('gmyth_test_monitor_handler', ["myth://%s:%s/livetv?channel=1" % (cfg_file.get_host(), cfg_file.get_port())], 2)
    8.12 -
    8.13 -finish(p)
    8.14 -
    8.15 -p = start('gmyth_test_monitor_handler', ["myth://%s:%s/livetv?channel=1" % (cfg_file.get_host(), cfg_file.get_port())], 2)
    8.16 +p = start('gmyth_test_monitor_handler', ["myth://%s:%s/livetv?channel=%s" % (cfg_file.get_host(), \
    8.17 +        cfg_file.get_port(), cfg_file.get_tv_channel())], 2)
    8.18  
    8.19  sys.exit(finish(p))
     9.1 --- a/gmyth/tests/test_program_info.py	Wed May 16 21:56:47 2007 +0100
     9.2 +++ b/gmyth/tests/test_program_info.py	Wed May 16 23:21:58 2007 +0100
     9.3 @@ -8,6 +8,7 @@
     9.4  
     9.5  cfg_file = TestConfigFile('test_scripts.cfg')
     9.6  
     9.7 -p = start('gmyth_test_program_info', ["myth://%s:%s/livetv?channel=1" % (cfg_file.get_host(), cfg_file.get_port())], 2)
     9.8 +p = start('gmyth_test_program_info', ["myth://%s:%s/livetv?channel=%s" % (cfg_file.get_host(), \
     9.9 +        cfg_file.get_port(), cfg_file.get_tv_channel())], 2)
    9.10  
    9.11  sys.exit(finish(p))
    10.1 --- a/gmyth/tests/test_recorder.py	Wed May 16 21:56:47 2007 +0100
    10.2 +++ b/gmyth/tests/test_recorder.py	Wed May 16 23:21:58 2007 +0100
    10.3 @@ -8,7 +8,8 @@
    10.4  
    10.5  cfg_file = TestConfigFile('test_scripts.cfg')
    10.6  
    10.7 -p = start('gmyth_test_recorder', ["myth://%s:%s/livetv?channel=1" % (cfg_file.get_host(), cfg_file.get_port())], 2)
    10.8 +p = start('gmyth_test_recorder',["myth://%s:%s/livetv?channel=%s" % (cfg_file.get_host(), \
    10.9 +        cfg_file.get_port(), cfg_file.get_tv_channel())], 2)
   10.10  
   10.11  sys.exit(finish(p))
   10.12  
    11.1 --- a/gmyth/tests/test_recordings.py	Wed May 16 21:56:47 2007 +0100
    11.2 +++ b/gmyth/tests/test_recordings.py	Wed May 16 23:21:58 2007 +0100
    11.3 @@ -8,7 +8,8 @@
    11.4  
    11.5  cfg_file = TestConfigFile('test_scripts.cfg')
    11.6  
    11.7 -p = start('gmyth_test_recordings', ["myth://mythtv:mythtv@%s:%s/?mythconverg" % \
    11.8 -	(cfg_file.get_host(), cfg_file.get_port())], 2)
    11.9 +p = start('gmyth_test_recordings', ["myth://%s:%s@%s:%s/?%s" % \
   11.10 +	(cfg_file.get_db_user(), cfg_file.get_db_passwd(), cfg_file.get_host(), cfg_file.get_port(), \
   11.11 +	cfg_file.get_db_name())], 2)
   11.12  
   11.13  sys.exit(finish(p))
    12.1 --- a/gmyth/tests/utils.py	Wed May 16 21:56:47 2007 +0100
    12.2 +++ b/gmyth/tests/utils.py	Wed May 16 23:21:58 2007 +0100
    12.3 @@ -11,6 +11,11 @@
    12.4          else:
    12.5  	    self.host = '192.168.3.110'
    12.6  	    self.port = 6543
    12.7 +	    self.db_user = 'mythtv'
    12.8 +	    self.db_passwd = 'mythtv'
    12.9 +	    self.db_name = 'mythconverg'
   12.10 +	    self.filename = '1004_20070510161500.nuv'
   12.11 +	    self.tv_channel = 13
   12.12  
   12.13      def loadTestConfigFile(self, filename):
   12.14          """Load the test script's config data from a file."""
   12.15 @@ -20,11 +25,21 @@
   12.16              try:
   12.17                  host = config.get("GMyth Test Scripts Config", "Host")
   12.18                  port = config.get("GMyth Test Scripts Config", "Port")
   12.19 +                db_user = config.get("GMyth Test Scripts Config", "User")
   12.20 +                db_passwd = config.get("GMyth Test Scripts Config", "Password")
   12.21 +                db_name = config.get("GMyth Test Scripts Config", "Database")
   12.22 +                filename = config.get("GMyth Test Scripts Config", "Filename")
   12.23 +                tv_channel = config.get("GMyth Test Scripts Config", "Channel")
   12.24              except:
   12.25 -                raise "ConfigError", "Problems on configuration file (%s) " % filename
   12.26 +                raise "ConfigError", "Problems on configuration file (%s)!!!" % filename
   12.27              else:
   12.28                  self.host = host
   12.29                  self.port = port
   12.30 +                self.db_user = db_user
   12.31 +                self.db_passwd = db_passwd
   12.32 +                self.db_name = db_name
   12.33 +                self.filename = filename
   12.34 +                self.tv_channel = tv_channel
   12.35          else:
   12.36              print "Creating file %s..." % filename 
   12.37              self.create()
   12.38 @@ -35,6 +50,21 @@
   12.39      def get_port(self):
   12.40          return self.port
   12.41  
   12.42 +    def get_filename(self):
   12.43 +        return self.filename
   12.44 +
   12.45 +    def get_db_user(self):
   12.46 +        return self.db_user
   12.47 +
   12.48 +    def get_db_passwd(self):
   12.49 +        return self.db_passwd
   12.50 +
   12.51 +    def get_db_name(self):
   12.52 +        return self.db_name
   12.53 +
   12.54 +    def get_tv_channel(self):
   12.55 +        return self.tv_channel
   12.56 +
   12.57  def wait_string(file, string):
   12.58      while True:
   12.59          line = file.readline().strip()