Permalink
Browse files

Perform paranoid checks during tests

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
  • Loading branch information...
puiterwijk committed Oct 13, 2018
1 parent 4c015f0 commit 06ae75f75be7cb7b540e4e60bb0ceb807f35cc83
Showing with 11 additions and 1 deletion.
  1. +2 −0 config.yml.example
  2. +6 −0 functional_tests/base.go
  3. +3 −1 server/service/http-git-receive-pack.go
@@ -27,6 +27,8 @@ certificates:
git.example.com:
cert: /etc/pki/repospanner/public.crt
key: /etc/pki/repospanner/public.key
checks:
paranoid: false
hooks:
debug: false
bubblewrap:
@@ -618,6 +618,12 @@ func createTestConfig(t *testing.T, node string, nodenr nodeNrType, extras ...st
node,
-1,
)
examplecfg = strings.Replace(
examplecfg,
"paranoid: false",
"paranoid: true",
-1,
)
if !useBubbleWrap {
examplecfg = strings.Replace(
examplecfg,
@@ -10,6 +10,8 @@ import (
"os"
"strings"

"github.com/spf13/viper"

"github.com/sirupsen/logrus"
"repospanner.org/repospanner/server/storage"
)
@@ -281,7 +283,7 @@ func (cfg *Service) serveGitReceivePack(w http.ResponseWriter, r *http.Request,
rw.isfullyread = true

// TODO: Determine when to be paranoid and check objects all the way down
paranoid := false
paranoid := viper.GetBool("checks.paranoid")
cfg.debugPacket(rw, sbstatus, "Validating objects...")
reqlogger.Debug("Validating all objects are reachable and sufficient")
if err := validateObjects(projectstore, toupdate, paranoid); err != nil {

0 comments on commit 06ae75f

Please sign in to comment.