summaryrefslogtreecommitdiff
path: root/pkg/hooks/monitor_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/monitor_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/monitor_test.go')
-rw-r--r--pkg/hooks/monitor_test.go22
1 files changed, 3 insertions, 19 deletions
diff --git a/pkg/hooks/monitor_test.go b/pkg/hooks/monitor_test.go
index b3af4bb43..31d7f9e39 100644
--- a/pkg/hooks/monitor_test.go
+++ b/pkg/hooks/monitor_test.go
@@ -11,7 +11,6 @@ import (
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/stretchr/testify/assert"
- "golang.org/x/text/language"
)
func TestMonitorOneDirGood(t *testing.T) {
@@ -22,12 +21,7 @@ func TestMonitorOneDirGood(t *testing.T) {
}
defer os.RemoveAll(dir)
- 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)
}
@@ -132,12 +126,7 @@ func TestMonitorTwoDirGood(t *testing.T) {
}
defer os.RemoveAll(fallbackDir)
- lang, err := language.Parse("und-u-va-posix")
- if err != nil {
- t.Fatal(err)
- }
-
- manager, err := New(ctx, []string{fallbackDir, primaryDir}, []string{}, lang)
+ manager, err := New(ctx, []string{fallbackDir, primaryDir}, []string{})
if err != nil {
t.Fatal(err)
}
@@ -312,12 +301,7 @@ func TestMonitorTwoDirGood(t *testing.T) {
func TestMonitorBadWatcher(t *testing.T) {
ctx := context.Background()
- lang, err := language.Parse("und-u-va-posix")
- if err != nil {
- t.Fatal(err)
- }
-
- manager, err := New(ctx, []string{}, []string{}, lang)
+ manager, err := New(ctx, []string{}, []string{})
if err != nil {
t.Fatal(err)
}