diff --git a/tests/antennas_test.go b/tests/antennas_test.go index 19bad7a63..8d9db9c76 100644 --- a/tests/antennas_test.go +++ b/tests/antennas_test.go @@ -46,6 +46,17 @@ var antennaChecks = map[string]func(*meta.Set) func(t *testing.T){ } }, + "check for invalid installation dates": func(set *meta.Set) func(t *testing.T) { + return func(t *testing.T) { + for _, i := range set.InstalledAntennas() { + if i.End.After(i.Start) { + continue + } + t.Errorf("installed antenna is removed before it has been installed: %s", i.String()) + } + } + }, + "check for antenna installation mark overlaps": func(set *meta.Set) func(t *testing.T) { return func(t *testing.T) { installs := make(map[string]meta.InstalledAntennaList) diff --git a/tests/cameras_test.go b/tests/cameras_test.go index 6354d3637..81d84f010 100644 --- a/tests/cameras_test.go +++ b/tests/cameras_test.go @@ -46,6 +46,17 @@ var cameraChecks = map[string]func(*meta.Set) func(t *testing.T){ } }, + "check for invalid installation dates": func(set *meta.Set) func(t *testing.T) { + return func(t *testing.T) { + for _, i := range set.InstalledCameras() { + if i.End.After(i.Start) { + continue + } + t.Errorf("installed camera is removed before it has been installed: %s", i.String()) + } + } + }, + "check for cameras installation mount overlaps": func(set *meta.Set) func(t *testing.T) { return func(t *testing.T) { keys := make(map[string]interface{}) diff --git a/tests/dataloggers_test.go b/tests/dataloggers_test.go index 1983fac29..e8c6cb82b 100644 --- a/tests/dataloggers_test.go +++ b/tests/dataloggers_test.go @@ -90,6 +90,17 @@ var dataloggerChecks = map[string]func(*meta.Set) func(t *testing.T){ } } }, + + "check for invalid installation dates": func(set *meta.Set) func(t *testing.T) { + return func(t *testing.T) { + for _, i := range set.DeployedDataloggers() { + if i.End.After(i.Start) { + continue + } + t.Errorf("deployed datalogger is removed before it has been installed: %s", i.String()) + } + } + }, } func TestDataloggers(t *testing.T) { diff --git a/tests/doases_test.go b/tests/doases_test.go index 144744d7f..7c6860b4e 100644 --- a/tests/doases_test.go +++ b/tests/doases_test.go @@ -46,6 +46,17 @@ var doasChecks = map[string]func(*meta.Set) func(t *testing.T){ } }, + "check for invalid installation dates": func(set *meta.Set) func(t *testing.T) { + return func(t *testing.T) { + for _, i := range set.Doases() { + if i.End.After(i.Start) { + continue + } + t.Errorf("installed doas is removed before it has been installed: %s", i.String()) + } + } + }, + "check for doases installation mount overlaps": func(set *meta.Set) func(t *testing.T) { return func(t *testing.T) { keys := make(map[string]interface{}) diff --git a/tests/metsensors_test.go b/tests/metsensors_test.go index b8c8b63cf..5b0b300e3 100644 --- a/tests/metsensors_test.go +++ b/tests/metsensors_test.go @@ -44,6 +44,16 @@ var metSensorChecks = map[string]func(*meta.Set) func(t *testing.T){ } } }, + "check for invalid installation dates": func(set *meta.Set) func(t *testing.T) { + return func(t *testing.T) { + for _, i := range set.InstalledMetSensors() { + if i.End.After(i.Start) { + continue + } + t.Errorf("installed metsensor is removed before it has been installed: %s", i.String()) + } + } + }, "check for missing metsensor marks": func(set *meta.Set) func(t *testing.T) { return func(t *testing.T) { keys := make(map[string]interface{}) diff --git a/tests/radomes_test.go b/tests/radomes_test.go index a34e9edd3..51d71448d 100644 --- a/tests/radomes_test.go +++ b/tests/radomes_test.go @@ -34,7 +34,6 @@ var installedRadomeChecks = map[string]func(*meta.Set) func(t *testing.T){ } } }, - "check for overlapping radomes installations": func(set *meta.Set) func(t *testing.T) { return func(t *testing.T) { installs := make(map[string]meta.InstalledRadomeList) @@ -63,6 +62,17 @@ var installedRadomeChecks = map[string]func(*meta.Set) func(t *testing.T){ } }, + "check for invalid installation dates": func(set *meta.Set) func(t *testing.T) { + return func(t *testing.T) { + for _, i := range set.InstalledRadomes() { + if i.End.After(i.Start) { + continue + } + t.Errorf("installed radome is removed before it has been installed: %s", i.String()) + } + } + }, + "check for missing radome marks": func(set *meta.Set) func(t *testing.T) { return func(t *testing.T) { diff --git a/tests/receivers_test.go b/tests/receivers_test.go index ee7ccdca8..23b9e8081 100644 --- a/tests/receivers_test.go +++ b/tests/receivers_test.go @@ -63,6 +63,17 @@ var deployedReceiverChecks = map[string]func(*meta.Set) func(t *testing.T){ } }, + "check for invalid installation dates": func(set *meta.Set) func(t *testing.T) { + return func(t *testing.T) { + for _, i := range set.DeployedReceivers() { + if i.End.After(i.Start) { + continue + } + t.Errorf("deployed receiver is removed before it has been installed: %s", i.String()) + } + } + }, + "check for missing receiver marks": func(set *meta.Set) func(t *testing.T) { return func(t *testing.T) { diff --git a/tests/recorders_test.go b/tests/recorders_test.go index 418ef801b..c6d5bbba0 100644 --- a/tests/recorders_test.go +++ b/tests/recorders_test.go @@ -47,6 +47,17 @@ var installedRecorderChecks = map[string]func(*meta.Set) func(t *testing.T){ } }, + "check for invalid installation dates": func(set *meta.Set) func(t *testing.T) { + return func(t *testing.T) { + for _, i := range set.InstalledRecorders() { + if i.End.After(i.Start) { + continue + } + t.Errorf("installed recorder is removed before it has been installed: %s", i.String()) + } + } + }, + "check for invalid sensor azimuth": func(set *meta.Set) func(t *testing.T) { return func(t *testing.T) { diff --git a/tests/sensors_test.go b/tests/sensors_test.go index 2b1993b79..44fe2a19c 100644 --- a/tests/sensors_test.go +++ b/tests/sensors_test.go @@ -47,6 +47,17 @@ var installedSensorChecks = map[string]func(*meta.Set) func(t *testing.T){ } }, + "check for invalid installation dates": func(set *meta.Set) func(t *testing.T) { + return func(t *testing.T) { + for _, i := range set.InstalledSensors() { + if i.End.After(i.Start) { + continue + } + t.Errorf("installed sensor is removed before it has been installed: %s", i.String()) + } + } + }, + "check for invalid sensor azimuth": func(set *meta.Set) func(t *testing.T) { return func(t *testing.T) {