Skip to content

Commit

Permalink
Bypass ipset in testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy5189 committed Jan 29, 2024
1 parent d0deaf8 commit f1da324
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions fixtures/banjax-config-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion internal/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
4 changes: 4 additions & 0 deletions internal/iptables.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f1da324

Please sign in to comment.