Skip to content

Commit 56a70f0

Browse files
committed
firewalldb: add expectedActions to mig tests res
In preparation for the kvdb to SQL migration of the actions store, this commit adds an `actions` field to the expected result of the migration tests. Once the migration is implemented, this field will be used to validate that the migrated actions match the expected results.
1 parent e47f08f commit 56a70f0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

firewalldb/sql_migration_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ var (
3939
type expectedResult struct {
4040
kvEntries []*kvEntry
4141
privPairs privacyPairs
42+
actions []*Action
4243
}
4344

4445
// TestFirewallDBMigration tests the migration of firewalldb from a bolt
@@ -306,6 +307,7 @@ func TestFirewallDBMigration(t *testing.T) {
306307
return &expectedResult{
307308
kvEntries: []*kvEntry{},
308309
privPairs: make(privacyPairs),
310+
actions: []*Action{},
309311
}
310312
},
311313
},
@@ -545,6 +547,7 @@ func allEntryCombinations(t *testing.T, ctx context.Context, boltDB *BoltDB,
545547
return &expectedResult{
546548
kvEntries: result,
547549
privPairs: make(privacyPairs),
550+
actions: []*Action{},
548551
}
549552
}
550553

@@ -594,6 +597,7 @@ func insertTempAndPermEntry(t *testing.T, ctx context.Context,
594597
kvEntries: []*kvEntry{tempKvEntry, permKvEntry},
595598
// No privacy pairs are inserted in this test.
596599
privPairs: make(privacyPairs),
600+
actions: []*Action{},
597601
}
598602
}
599603

@@ -758,6 +762,7 @@ func randomKVEntries(t *testing.T, ctx context.Context,
758762
kvEntries: insertedEntries,
759763
// No privacy pairs are inserted in this test.
760764
privPairs: make(privacyPairs),
765+
actions: []*Action{},
761766
}
762767
}
763768

@@ -836,6 +841,7 @@ func createPrivacyPairs(t *testing.T, ctx context.Context,
836841
return &expectedResult{
837842
kvEntries: []*kvEntry{},
838843
privPairs: pairs,
844+
actions: []*Action{},
839845
}
840846
}
841847

@@ -889,6 +895,7 @@ func randomPrivacyPairs(t *testing.T, ctx context.Context,
889895
return &expectedResult{
890896
kvEntries: []*kvEntry{},
891897
privPairs: pairs,
898+
actions: []*Action{},
892899
}
893900
}
894901

@@ -906,6 +913,7 @@ func randomFirewallDBEntries(t *testing.T, ctx context.Context,
906913
return &expectedResult{
907914
kvEntries: kvEntries.kvEntries,
908915
privPairs: privPairs.privPairs,
916+
actions: []*Action{},
909917
}
910918
}
911919

0 commit comments

Comments
 (0)