Ejemplo n.º 1
0
from csapiunittest import TestLoader, TextTestRunner
from storage import ComputeNodes 
import unittest2
import integration
from integration import TestDaemon

class StdTest(unittest2.TestCase):
    def setUp(self):
        unittest2.TestCase.setUp(self)
        self.testclass = ComputeNodes()

    def tearDown(self):
        unittest2.TestCase.tearDown(self)
        self.testclass.close()

    def test_get_junk(self):
        ret = self.testclass.get_junk()
        self.assertTrue(ret)

    def test_set_junk(self):
        ret = self.testclass.set_junk()
        self.assertTrue(ret)

if __name__ == "__main__":
    loader = TestLoader()
    tests = loader.loadTestsFromTestCase(StdTest)
    print('Setting up environment')
    with TestDaemon():
        auth = TextTestRunner(verbosity=1).run(tests)
        sys.exit(auth.wasSuccessful())
Ejemplo n.º 2
0
#        print "\nReboot:", ret
#
#    def test_delete_node(self):
#        node = self.comuptetest.get_node("test")
#        ret = self.comuptetest.delete_node(node.uuid)
#        print "\nDelete:", ret
#
#    def test_create_node(self):
#        compute_nodes = self.comuptetest.create_node("test", "Ubuntu 12.04 cloudimg amd64", "tiny", 2)
#        ret = self.comuptetest.get_node(node.uuid)
#        print "\nCreate:", ret
#        self.assertTrue(ret)
#
#    def test_get_private_ips(self):
#        node = self.comuptetest.get_node("ubuntu_small")
#        ret = self.comuptetest.get_private_ips(node.uuid)
#        print "PRIVATE_IP: \n", ret
#        self.assertTrue(ret)
#
#    def test_get_public_ips(self):
#        ret = self.comuptetest.get_public_ips()
#        print "PUBLIC_IP: \n", ret
#        self.assertTrue(ret)

if __name__ == "__main__":
    loader = TestLoader()
    tests = loader.loadTestsFromTestCase(StdTest)
    with TestDaemon():
        compute = TextTestRunner(verbosity=1).run(tests)
        sys.exit(compute.wasSuccessful())