class IntegrationTestDecoratorTest(testsuite.TestCase): #@integration.test <- FIXME: P2.3 def testTransientProcess(self, plan): p = plan.spawn('echo', 'foo') plan.wait(p, 0) testTransientProcess = integration.test(testTransientProcess) #@integration.test def testParallelWait(self, plan): p1, p2 = plan.spawnPar(('echo', 'foo'), ('echo', 'bar')) plan.waitPar((p1, 0), (p2, 0)) testParallelWait = integration.test(testParallelWait) #@integration.test def testFalse(self, plan): p = plan.spawn('false') plan.wait(p, 1) testFalse = integration.test(testFalse) #@integration.test def testKill(self, plan): p = plan.spawn('cat', '/dev/random') plan.kill(p) testKill = integration.test(testKill) #@integration.test def testParallelStartAndKill(self, plan): p1, p2 = plan.spawnPar(('cat', '/dev/random'), ('cat', '/dev/random')) plan.kill(p1) plan.kill(p2) testParallelStartAndKill = integration.test(testParallelStartAndKill)
class TestStopStart(common.FlumotionManagerWorkerTest): def testAudioTestMultipleStopStarts(self, plan): m, w = self.spawnAndWaitManagerWorker(plan) httpPort = random.randrange(12800, 12899) self.makeFile('audiotest.xml', audioTestXML % (httpPort, os.getcwd())) self.loadConfiguration(plan, 'audiotest.xml') for i in range(0, 10): self.waitForHappyComponent(plan, '/default/http-audio') self.waitForHappyComponent(plan, '/default/disk-audio') self.stopAll(plan) self.startAll(plan) plan.kill(w, 0) plan.kill(m, 0) testAudioTestMultipleStopStarts = integration.test( testAudioTestMultipleStopStarts)
class TestFlumotion(common.FlumotionManagerWorkerTest): def testManagerWorker(self, plan): m, w = self.spawnAndWaitManagerWorker(plan) plan.kill(w, 0) plan.kill(m, 0) testManagerWorker = integration.test(testManagerWorker) def testHttpFile(self, plan): m, w = self.spawnAndWaitManagerWorker(plan) httpPort = random.randrange(12800, 12899) self.makeFile('httpfile-config.xml', httpFileXML % (httpPort, __file__)) self.loadConfiguration(plan, 'httpfile-config.xml') self.waitForHappyComponent(plan, '/default/httpfile') # wait for httpfile h = plan.spawn('wait-for-http-port', 'http://*****:*****@localhost:%d' % self.managerPort, '/default/disk-video') plan.wait(cft, 0) # clean up disk files clean = plan.spawn('remove-disker-files', 'user:test@localhost:%d' % (self.managerPort, ), '/default/disk-video') plan.wait(clean, 0) plan.kill(w, 0) plan.kill(m, 0) testVideoTestNoOverlay = integration.test(testVideoTestNoOverlay) def testVideoTestNoOverlayWithTokenBouncer(self, plan): m, w = self.spawnAndWaitManagerWorker(plan) httpPort = random.randrange(12800, 12899) self.makeFile('tokenbouncer.xml', videoTestNoOverlayWithTokenBouncerXML % httpPort) self.loadConfiguration(plan, 'tokenbouncer.xml') self.waitForHappyComponent(plan, '/default/video-source') self.waitForHappyComponent(plan, '/default/muxer-video') self.waitForHappyComponent(plan, '/default/http-video') self.waitForHappyComponent(plan, '/atmosphere/tokenbouncer') h = plan.spawn('check-token-for-http', 'http://*****:*****@localhost:%d' % self.managerPort, '/default/disk-audio') plan.wait(cft, 0) # clean up disk files clean = plan.spawn('remove-disker-files', 'user:test@localhost:%d' % (self.managerPort, ), '/default/disk-audio') plan.wait(clean, 0) plan.kill(w, 0) plan.kill(m, 0) testAudioTest = integration.test(testAudioTest) def testVideoTestWithOverlay(self, plan): m, w = self.spawnAndWaitManagerWorker(plan) httpPort = random.randrange(12800, 12899) self.makeFile('videotest.xml', videoTestXML % (httpPort, os.getcwd())) self.loadConfiguration(plan, 'videotest.xml') self.waitForHappyComponent(plan, '/default/video-source') self.waitForHappyComponent(plan, '/default/muxer-video') self.waitForHappyComponent(plan, '/default/http-video') self.waitForHappyComponent(plan, '/default/disk-video') h = plan.spawn('wait-for-http-headers', 'http://*****:*****@localhost:%d' % self.managerPort, '/default/disk-video') plan.wait(cft, 0) # clean up disk files clean = plan.spawn('remove-disker-files', 'user:test@localhost:%d' % (self.managerPort, ), '/default/disk-video') plan.wait(clean, 0) plan.kill(w, 0) plan.kill(m, 0) testVideoTestWithOverlay = integration.test(testVideoTestWithOverlay)