aboutsummaryrefslogtreecommitdiff
path: root/pkg/hooks/hooks_test.go
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2019-03-02 06:36:44 +0100
committerMiloslav Trmač <mitr@redhat.com>2019-04-09 21:08:44 +0200
commit97c9115c02b05f9aa0120b84deffed8b7b3d6018 (patch)
tree97e103ca1c4186d554ddb36295739eb34e2c2ed8 /pkg/hooks/hooks_test.go
parentfe79bdd07e140176dc64ebef8da3eea2ae28b96b (diff)
downloadpodman-97c9115c02b05f9aa0120b84deffed8b7b3d6018.tar.gz
podman-97c9115c02b05f9aa0120b84deffed8b7b3d6018.tar.bz2
podman-97c9115c02b05f9aa0120b84deffed8b7b3d6018.zip
Potentially breaking: Make hooks sort order locale-independent
Don't sort OCI hooks using the locale collation order; it does not make sense for the same system-wide directory to be interpreted differently depending on the user's LC_COLLATE setting, and the language-specific collation order can even change over time. Besides, the current collation order determination code has never worked with the most common LC_COLLATE values like en_US.UTF-8. Ideally, we would like to just order based on Unicode code points to be reliably stable, but the existing implementation is case-insensitive, so we are forced to rely on the unicode case mapping tables at least. (This gives up on canonicalization and width-insensitivity, potentially breaking users who rely on these previously documented properties.) Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 'pkg/hooks/hooks_test.go')
-rw-r--r--pkg/hooks/hooks_test.go15
1 files changed, 2 insertions, 13 deletions
diff --git a/pkg/hooks/hooks_test.go b/pkg/hooks/hooks_test.go
index 2925a99e4..02cde6d64 100644
--- a/pkg/hooks/hooks_test.go
+++ b/pkg/hooks/hooks_test.go
@@ -12,7 +12,6 @@ import (
current "github.com/containers/libpod/pkg/hooks/1.0.0"
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/stretchr/testify/assert"
- "golang.org/x/text/language"
)
// path is the path to an example hook executable.
@@ -43,12 +42,7 @@ func TestGoodNew(t *testing.T) {
}
}
- lang, err := language.Parse("und-u-va-posix")
- if err != nil {
- t.Fatal(err)
- }
-
- manager, err := New(ctx, []string{dir}, []string{}, lang)
+ manager, err := New(ctx, []string{dir}, []string{})
if err != nil {
t.Fatal(err)
}
@@ -110,12 +104,7 @@ func TestBadNew(t *testing.T) {
t.Fatal(err)
}
- lang, err := language.Parse("und-u-va-posix")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = New(ctx, []string{dir}, []string{}, lang)
+ _, err = New(ctx, []string{dir}, []string{})
if err == nil {
t.Fatal("unexpected success")
}