open-vault/helper/versions/version_test.go
Tom Proctor 853643d02b
Remove pinned builtin plugin versions from storage (#18051)
* Removes _builtin_ versions from mount storage where it already exists
* Stops new builtin versions being put into storage on mount creation/tuning
* Stops the plugin catalog from returning a builtin plugin that has been overridden, so it more accurately reflects the plugins that are available to actually run
2022-11-23 18:36:25 +00:00

24 lines
528 B
Go

package versions
import "testing"
func TestIsBuiltinVersion(t *testing.T) {
for _, tc := range []struct {
version string
builtin bool
}{
{"v1.0.0+builtin", true},
{"v2.3.4+builtin.vault", true},
{"1.0.0+builtin.anythingelse", true},
{"v1.0.0+other.builtin", true},
{"v1.0.0+builtinbutnot", false},
{"v1.0.0", false},
{"not-a-semver", false},
} {
builtin := IsBuiltinVersion(tc.version)
if builtin != tc.builtin {
t.Fatalf("%s should give: %v, but got %v", tc.version, tc.builtin, builtin)
}
}
}