Revision acd65a16 test/ganeti.masterd.instance_unittest.py

b/test/ganeti.masterd.instance_unittest.py
111 111
      self.assertRaises(errors.GenericError, CheckRemoteExportDiskInfo,
112 112
                        cds, i, di)
113 113

  
114
  def testInvalidHostPort(self):
115
    cds = "3ZoJY8KtGJ"
116
    salt = "drK5oYiHWD"
117

  
118
    for host in [",", "...", "Hello World", "`", "!", "#", "\\"]:
119
      di = ComputeRemoteImportDiskInfo(cds, salt, 0, host, 1234)
120
      self.assertRaises(errors.OpPrereqError,
121
                        CheckRemoteExportDiskInfo, cds, 0, di)
122

  
123
    for port in [-1, 792825908, "HelloWorld!", "`#", "\\\"", "_?_"]:
124
      di = ComputeRemoteImportDiskInfo(cds, salt, 0, "localhost", port)
125
      self.assertRaises(errors.OpPrereqError,
126
                        CheckRemoteExportDiskInfo, cds, 0, di)
127

  
114 128
  def testCheckErrors(self):
115 129
    cds = "0776450535a"
116 130
    self.assertRaises(errors.GenericError, CheckRemoteExportDiskInfo,

Also available in: Unified diff