]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cypherpunks.ru/nncp/toss_test.go
-dryrun for tosser
[nncp.git] / src / cypherpunks.ru / nncp / toss_test.go
index 001a25b5618191230e322f8f85ec6b4795ec929a..ee8ae80e6488c9c8a9a9e2b347c3a04f13fe3e04 100644 (file)
@@ -103,12 +103,12 @@ func TestTossEmail(t *testing.T) {
                        if len(dirFiles(rxPath)) == 0 {
                                continue
                        }
-                       ctx.Toss(ctx.Self.Id, DefaultNiceMail-1)
+                       ctx.Toss(ctx.Self.Id, DefaultNiceMail-1, false)
                        if len(dirFiles(rxPath)) == 0 {
                                return false
                        }
                        ctx.Neigh[*nodeOur.Id].Sendmail = []string{"/bin/sh", "-c", "false"}
-                       ctx.Toss(ctx.Self.Id, DefaultNiceMail)
+                       ctx.Toss(ctx.Self.Id, DefaultNiceMail, false)
                        if len(dirFiles(rxPath)) == 0 {
                                return false
                        }
@@ -116,7 +116,7 @@ func TestTossEmail(t *testing.T) {
                                "/bin/sh", "-c",
                                fmt.Sprintf("cat >> %s", filepath.Join(spool, "mbox")),
                        }
-                       ctx.Toss(ctx.Self.Id, DefaultNiceMail)
+                       ctx.Toss(ctx.Self.Id, DefaultNiceMail, false)
                        if len(dirFiles(rxPath)) != 0 {
                                return false
                        }
@@ -186,12 +186,12 @@ func TestTossFile(t *testing.T) {
                }
                rxPath := filepath.Join(spool, ctx.Self.Id.String(), string(TRx))
                os.Rename(filepath.Join(spool, ctx.Self.Id.String(), string(TTx)), rxPath)
-               ctx.Toss(ctx.Self.Id, DefaultNiceFile)
+               ctx.Toss(ctx.Self.Id, DefaultNiceFile, false)
                if len(dirFiles(rxPath)) == 0 {
                        return false
                }
                ctx.Neigh[*nodeOur.Id].Incoming = &incomingPath
-               ctx.Toss(ctx.Self.Id, DefaultNiceFile)
+               ctx.Toss(ctx.Self.Id, DefaultNiceFile, false)
                if len(dirFiles(rxPath)) != 0 {
                        return false
                }
@@ -256,7 +256,7 @@ func TestTossFileSameName(t *testing.T) {
                rxPath := filepath.Join(spool, ctx.Self.Id.String(), string(TRx))
                os.Rename(filepath.Join(spool, ctx.Self.Id.String(), string(TTx)), rxPath)
                ctx.Neigh[*nodeOur.Id].Incoming = &incomingPath
-               ctx.Toss(ctx.Self.Id, DefaultNiceFile)
+               ctx.Toss(ctx.Self.Id, DefaultNiceFile, false)
                expected := make(map[string]struct{})
                expected["samefile"] = struct{}{}
                for i := 0; i < files-1; i++ {
@@ -322,12 +322,12 @@ func TestTossFreq(t *testing.T) {
                txPath := filepath.Join(spool, ctx.Self.Id.String(), string(TTx))
                os.Rename(txPath, rxPath)
                os.MkdirAll(txPath, os.FileMode(0700))
-               ctx.Toss(ctx.Self.Id, DefaultNiceFreq)
+               ctx.Toss(ctx.Self.Id, DefaultNiceFreq, false)
                if len(dirFiles(txPath)) != 0 || len(dirFiles(rxPath)) == 0 {
                        return false
                }
                ctx.Neigh[*nodeOur.Id].Freq = &spool
-               ctx.Toss(ctx.Self.Id, DefaultNiceFreq)
+               ctx.Toss(ctx.Self.Id, DefaultNiceFreq, false)
                if len(dirFiles(txPath)) != 0 || len(dirFiles(rxPath)) == 0 {
                        return false
                }
@@ -340,7 +340,7 @@ func TestTossFreq(t *testing.T) {
                                panic(err)
                        }
                }
-               ctx.Toss(ctx.Self.Id, DefaultNiceFreq)
+               ctx.Toss(ctx.Self.Id, DefaultNiceFreq, false)
                if len(dirFiles(txPath)) == 0 || len(dirFiles(rxPath)) != 0 {
                        return false
                }
@@ -431,7 +431,7 @@ func TestTossTrns(t *testing.T) {
                                panic(err)
                        }
                }
-               ctx.Toss(ctx.Self.Id, 123)
+               ctx.Toss(ctx.Self.Id, 123, false)
                if len(dirFiles(rxPath)) != 0 {
                        return false
                }