Ejemplo n.º 1
0
 def testExitCode(self):
     pl = Pipeline(("false", ))
     e = None
     try:
         pl.wait()
     except ProcException, e:
         pass
Ejemplo n.º 2
0
 def testExitCode(self):
     pl = Pipeline(("false",))
     e = None
     try:
         pl.wait()
     except ProcException, e:
         pass
Ejemplo n.º 3
0
    def testReadMult(self):
        inf = self.getInputFile("simple1.txt")

        pl = Pipeline((("gzip", "-1c"), ("gzip", "-dc"), ("wc",), ("sed", "-e", "s/  */\t/g")), "r", otherEnd=inf)
        self.cpPlToFile(pl, ".wc")
        pl.wait()

        self.diffExpected(".wc")
Ejemplo n.º 4
0
    def testWriteMult(self):
        outf = self.getOutputFile(".wc")

        # grr, BSD wc adds an extract space, so just convert to tabs
        pl = Pipeline((("gzip", "-1"), ("gzip", "-dc"), ("wc",), ("sed", "-e", "s/  */\t/g")), "w", otherEnd=outf)
        self.cpFileToPl("simple1.txt", pl)
        pl.wait()

        self.diffExpected(".wc")
Ejemplo n.º 5
0
    def testRead(self):
        inf = self.getInputFile("simple1.txt")
        infGz = self.getOutputFile(".txt.gz")
        procOps.runProc(("gzip", "-c", inf), stdout=infGz)

        pl = Pipeline(("gzip", "-dc"), "r", otherEnd=infGz)
        self.cpPlToFile(pl, ".out")
        pl.wait()

        self.diffExpected(".out")
Ejemplo n.º 6
0
    def testWrite(self):
        outf = self.getOutputFile(".out")
        outfGz = self.getOutputFile(".out.gz")

        pl = Pipeline(("gzip", "-1"), "w", otherEnd=outfGz)
        self.cpFileToPl("simple1.txt", pl)
        pl.wait()

        procOps.runProc(("zcat", outfGz), stdout=outf)
        self.diffExpected(".out")
Ejemplo n.º 7
0
    def testRead(self):
        inf = self.getInputFile("simple1.txt")
        infGz = self.getOutputFile(".txt.gz")
        procOps.runProc(("gzip", "-c", inf), stdout=infGz)

        pl = Pipeline(("gzip", "-dc"), "r", otherEnd=infGz)
        self.cpPlToFile(pl, ".out")
        pl.wait()

        self.diffExpected(".out")
Ejemplo n.º 8
0
    def testWrite(self):
        outf = self.getOutputFile(".out")
        outfGz = self.getOutputFile(".out.gz")

        pl = Pipeline(("gzip", "-1"), "w", otherEnd=outfGz)
        self.cpFileToPl("simple1.txt", pl)
        pl.wait()

        procOps.runProc(("zcat", outfGz), stdout=outf)
        self.diffExpected(".out")
Ejemplo n.º 9
0
    def testReadMult(self):
        inf = self.getInputFile("simple1.txt")

        pl = Pipeline((("gzip", "-1c"), ("gzip", "-dc"), ("wc", ),
                       ("sed", "-e", "s/  */\t/g")),
                      "r",
                      otherEnd=inf)
        self.cpPlToFile(pl, ".wc")
        pl.wait()

        self.diffExpected(".wc")
Ejemplo n.º 10
0
    def XXtestPassWrite(self):
        "using FIFO to pass pipe to another process for writing"
        # FIXME: should this be supported somehow
        inf = self.getInputFile("simple1.txt")
        outf = self.getOutputFile(".out")
        pipePath = self.getOutputFile(".fifo")

        pl = Pipeline(("sort", "-r"), "w", otherEnd=outf, pipePath=pipePath)
        procOps.runProc(["cat"], stdin=inf, stdout=pl.pipePath)
        pl.wait()

        self.diffExpected(".out")
Ejemplo n.º 11
0
    def testWriteMult(self):
        outf = self.getOutputFile(".wc")

        # grr, BSD wc adds an extract space, so just convert to tabs
        pl = Pipeline((("gzip", "-1"), ("gzip", "-dc"), ("wc", ),
                       ("sed", "-e", "s/  */\t/g")),
                      "w",
                      otherEnd=outf)
        self.cpFileToPl("simple1.txt", pl)
        pl.wait()

        self.diffExpected(".wc")
Ejemplo n.º 12
0
    def XXtestPassWrite(self):
        "using FIFO to pass pipe to another process for writing"
        # FIXME: should this be supported somehow
        inf = self.getInputFile("simple1.txt")
        outf = self.getOutputFile(".out")
        pipePath = self.getOutputFile(".fifo")

        pl = Pipeline(("sort", "-r"), "w", otherEnd=outf, pipePath=pipePath)
        procOps.runProc(["cat"], stdin=inf, stdout=pl.pipePath)
        pl.wait()

        self.diffExpected(".out")
Ejemplo n.º 13
0
    def XXtestPassRead(self):
        "using FIFO to pass pipe to another process for reading"
        # FIXME: should this be supported somehow
        inf = self.getInputFile("simple1.txt")
        infGz = self.getOutputFile(".txt.gz")
        cpOut = self.getOutputFile(".out")
        procOps.runProc(("gzip", "-c", inf), stdout=infGz)

        pl = Pipeline(("gzip", "-dc"), "r", otherEnd=infGz)
        procOps.runProc(["cat"], stdin=pl.pipePath, stdout=cpOut)
        pl.wait()

        self.diffExpected(".out")
Ejemplo n.º 14
0
    def XXtestPassRead(self):
        "using FIFO to pass pipe to another process for reading"
        # FIXME: should this be supported somehow
        inf = self.getInputFile("simple1.txt")
        infGz = self.getOutputFile(".txt.gz")
        cpOut = self.getOutputFile(".out")
        procOps.runProc(("gzip", "-c", inf), stdout=infGz)

        pl = Pipeline(("gzip", "-dc"), "r", otherEnd=infGz)
        procOps.runProc(["cat"], stdin=pl.pipePath, stdout=cpOut)
        pl.wait()

        self.diffExpected(".out")
Ejemplo n.º 15
0
 def testSigPipe(self):
     "test not reading all of pipe output"
     pl = Pipeline([("yes", ), ("true", )], "r")
     pl.wait()
Ejemplo n.º 16
0
 def testSigPipe(self):
     "test not reading all of pipe output"
     pl = Pipeline([("yes",), ("true",)], "r")
     pl.wait()