예제 #1
0
파일: lxc_test.py 프로젝트: noxdafox/see
 def test_domain_xml_filesystem(self):
     """LXC XML with filesystem."""
     config = """<domain></domain>"""
     expected = """<domain><name>foo</name><uuid>foo</uuid><devices><filesystem type="mount">""" +\
                """<source dir="foo" /><target dir="bar" /></filesystem></devices></domain>"""
     results = lxc.domain_xml('foo', config, [('foo', 'bar')])
     self.assertEqual(results, expected, compare(results, expected))
예제 #2
0
파일: lxc_test.py 프로젝트: MahaKoala/see
 def test_domain_xml_modifies(self):
     """Fields are modified if existing."""
     config = """<domain><name>bar</name><uuid>bar</uuid></domain>"""
     expected = """<domain><name>foo</name><uuid>foo</uuid><devices><filesystem type="mount">""" +\
                """<source dir="foo" /><target dir="bar" /></filesystem></devices></domain>"""
     results = lxc.domain_xml('foo', config, [('foo', 'bar')])
     self.assertEqual(results, expected, compare(results, expected))
예제 #3
0
파일: lxc_test.py 프로젝트: zdzhjx/see
 def test_domain_xml_modifies(self):
     """Fields are modified if existing."""
     config = """<domain><name>bar</name><uuid>bar</uuid></domain>"""
     expected = """<domain><name>foo</name><uuid>foo</uuid><devices><filesystem type="mount">""" +\
                """<source dir="foo" /><target dir="bar" /></filesystem></devices></domain>"""
     results = lxc.domain_xml('foo', config, [('foo', 'bar')])
     self.assertEqual(results, expected, compare(results, expected))
예제 #4
0
파일: lxc_test.py 프로젝트: xx-zhang/see
 def test_domain_xml_filesystem(self):
     """LXC XML with filesystem."""
     config = """<domain></domain>"""
     expected = """<domain><name>foo</name><uuid>foo</uuid><devices><filesystem type="mount">""" +\
                """<source dir="foo" /><target dir="bar" /></filesystem></devices></domain>"""
     results = lxc.domain_xml('foo', config, [('foo', 'bar')])
     self.assertEqual(results, expected, compare(results, expected))
예제 #5
0
파일: lxc_test.py 프로젝트: MahaKoala/see
 def test_domain_xml_network(self):
     """XML with network fields are modified if existing."""
     config = """<domain></domain>"""
     expected = """<domain><name>foo</name><uuid>foo</uuid><devices><filesystem type="mount">""" +\
                """<source dir="foo" /><target dir="bar" /></filesystem><interface type="network">""" +\
                """<source network="foo" /></interface></devices></domain>"""
     results = lxc.domain_xml('foo', config, [('foo', 'bar')], network_name='foo')
     self.assertEqual(results, expected, compare(results, expected))
예제 #6
0
파일: lxc_test.py 프로젝트: zdzhjx/see
 def test_domain_xml_network(self):
     """XML with network fields are modified if existing."""
     config = """<domain></domain>"""
     expected = """<domain><name>foo</name><uuid>foo</uuid><devices><filesystem type="mount">""" +\
                """<source dir="foo" /><target dir="bar" /></filesystem><interface type="network">""" +\
                """<source network="foo" /></interface></devices></domain>"""
     results = lxc.domain_xml('foo',
                              config, [('foo', 'bar')],
                              network_name='foo')
     self.assertEqual(results, expected, compare(results, expected))
예제 #7
0
파일: lxc_test.py 프로젝트: MahaKoala/see
 def test_domain_xml(self):
     """XML with no network and no filesystem."""
     config = """<domain></domain>"""
     expected = """<domain><name>foo</name><uuid>foo</uuid><devices /></domain>"""
     results = lxc.domain_xml('foo', config, [])
     self.assertEqual(results, expected, compare(results, expected))
예제 #8
0
파일: lxc_test.py 프로젝트: zdzhjx/see
 def test_domain_xml(self):
     """XML with no network and no filesystem."""
     config = """<domain></domain>"""
     expected = """<domain><name>foo</name><uuid>foo</uuid><devices /></domain>"""
     results = lxc.domain_xml('foo', config, [])
     self.assertEqual(results, expected, compare(results, expected))