mirror of
https://github.com/gluster/glusterd2.git
synced 2026-02-05 12:45:38 +01:00
25 lines
496 B
Go
25 lines
496 B
Go
package utils
|
|
|
|
import (
|
|
"testing"
|
|
|
|
config "github.com/spf13/viper"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestGetVolumeDir(t *testing.T) {
|
|
config.Set("localstatedir", "/var/lib/glusterd2")
|
|
|
|
resp := GetVolumeDir("testvolume")
|
|
assert.Equal(t, resp, "/var/lib/glusterd2/vols/testvolume")
|
|
|
|
}
|
|
|
|
func TestGetSnapshotDir(t *testing.T) {
|
|
config.Set("localstatedir", "/var/lib/glusterd2")
|
|
|
|
resp := GetSnapshotDir("testvolume")
|
|
assert.Equal(t, resp, "/var/lib/glusterd2/snaps/testvolume")
|
|
|
|
}
|