Skip to content

Commit

Permalink
test(integration): reset all the forwards before each test
Browse files Browse the repository at this point in the history
Signed-off-by: Alessio Greggi <[email protected]>
  • Loading branch information
alegrey91 committed Aug 7, 2024
1 parent f1a408b commit bd4528d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tests/apply.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
exec fwdctl apply --help
stdout 'Usage:'

# remove all previously applied forwards
exec fwdctl delete --all

# test primarly subcommand 'apply'
exec fwdctl apply --file rules-2.yaml
fwd_exists lo tcp 3000 127.0.0.1 80
Expand Down
3 changes: 3 additions & 0 deletions tests/create.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
exec fwdctl create --help
stdout 'Usage:'

# remove all previously applied forwards
exec fwdctl delete --all

# test primarly subcommand 'create'
exec fwdctl create -d 3000 -s 127.0.0.1 -p 80 -i lo
fwd_exists lo tcp 3000 127.0.0.1 80
Expand Down
5 changes: 4 additions & 1 deletion tests/daemon.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
exec fwdctl daemon
stdout 'Usage:'

# remove all previously applied forwards
exec fwdctl delete --all

exec fwdctl daemon --help
stdout 'Usage:'

Expand Down Expand Up @@ -109,4 +112,4 @@ rules:
proto: tcp

-- empty-output.txt --
{}
{}
3 changes: 3 additions & 0 deletions tests/delete.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
exec fwdctl delete --help
stdout 'Usage:'

# remove all previously applied forwards
exec fwdctl delete --all

# delete e simple rule by passing id
exec fwdctl create -d 3000 -s 127.0.0.1 -p 80 -i lo
fwd_exists lo tcp 3000 127.0.0.1 80
Expand Down
3 changes: 3 additions & 0 deletions tests/list.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
exec fwdctl list --help
stdout 'Usage:'

# remove all previously applied forwards
exec fwdctl delete --all

# test primarly subcommand 'create'
exec fwdctl create -d 3000 -s 127.0.0.1 -p 80 -i lo
fwd_exists lo tcp 3000 127.0.0.1 80
Expand Down

0 comments on commit bd4528d

Please sign in to comment.