diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 248be39..7abba2c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,8 +27,6 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} - - name: Install ipset - run: sudo apt-get install -y ipset - name: Checkout code uses: actions/checkout@v2 - name: Run the integration tests @@ -44,8 +42,6 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} - - name: Install ipset - run: sudo apt-get install -y ipset - name: Checkout code uses: actions/checkout@v2 - name: Run the performance tests diff --git a/fixtures/banjax-config-test.yaml b/fixtures/banjax-config-test.yaml index 7af5c27..ce28171 100644 --- a/fixtures/banjax-config-test.yaml +++ b/fixtures/banjax-config-test.yaml @@ -91,3 +91,4 @@ sha_inv_cookie_ttl_seconds: 14400 # also modify internal/sha-inverse-challenge. hmac_secret: secret gin_log_file: /var/log/banjax/gin.log metrics_log_file: /var/log/banjax/metrics.log +standalone_testing: true diff --git a/internal/config.go b/internal/config.go index c59340e..daaab37 100644 --- a/internal/config.go +++ b/internal/config.go @@ -38,7 +38,7 @@ type Config struct { PerSiteDecisionLists map[string]map[string][]string `yaml:"per_site_decision_lists"` GlobalDecisionLists map[string][]string `yaml:"global_decision_lists"` ConfigVersion string `yaml:"config_version"` - StandaloneTesting bool + StandaloneTesting bool `yaml:"standalone_testing"` ChallengerBytes []byte PasswordPageBytes []byte SitesToPasswordHashes map[string]string `yaml:"password_hashes"` diff --git a/internal/iptables.go b/internal/iptables.go index 8793b05..5d6edbd 100644 --- a/internal/iptables.go +++ b/internal/iptables.go @@ -30,6 +30,10 @@ const ( func init_ipset(config *Config) { log.Println("http_server: init_ipset()") + if config.StandaloneTesting { + log.Println("init_ipset: Not init ipset in testing") + return + } if err := ipset.Check(); err != nil { log.Println("init_ipset() ipset.Check() failed") panic(err)