mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 04:34:23 -06:00
07582a8e85
* Chore: Fix various spelling errors in back-end code Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>>
41 lines
733 B
Go
41 lines
733 B
Go
// +build linux
|
|
|
|
package dashboards
|
|
|
|
import (
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"github.com/grafana/grafana/pkg/infra/log"
|
|
)
|
|
|
|
var (
|
|
symlinkedFolder = "testdata/test-dashboards/symlink"
|
|
)
|
|
|
|
func TestProvisionedSymlinkedFolder(t *testing.T) {
|
|
cfg := &config{
|
|
Name: "Default",
|
|
Type: "file",
|
|
OrgID: 1,
|
|
Folder: "",
|
|
Options: map[string]interface{}{"path": symlinkedFolder},
|
|
}
|
|
|
|
reader, err := NewDashboardFileReader(cfg, log.New("test-logger"))
|
|
if err != nil {
|
|
t.Error("expected err to be nil")
|
|
}
|
|
|
|
want, err := filepath.Abs(containingID)
|
|
|
|
if err != nil {
|
|
t.Errorf("expected err to be nil")
|
|
}
|
|
|
|
resolvedPath := reader.resolvedPath()
|
|
if resolvedPath != want {
|
|
t.Errorf("got %s want %s", resolvedPath, want)
|
|
}
|
|
}
|