mirror of
https://github.com/mudler/luet.git
synced 2025-08-31 14:52:02 +00:00
Use dynamic pkgs cache dir for test suite
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -44,9 +45,12 @@ func GetSystemRepoDatabaseDirPath() string {
|
||||
}
|
||||
|
||||
func GetSystemPkgsCacheDirPath() (ans string) {
|
||||
cachepath := "packages"
|
||||
var cachepath string
|
||||
if config.LuetCfg.GetSystem().PkgsCachePath != "" {
|
||||
cachepath = config.LuetCfg.GetSystem().PkgsCachePath
|
||||
} else {
|
||||
// Create dynamic cache for test suites
|
||||
cachepath, _ = ioutil.TempDir(os.TempDir(), "cachepkgs")
|
||||
}
|
||||
|
||||
if filepath.IsAbs(cachepath) {
|
||||
|
@@ -28,5 +28,9 @@ import (
|
||||
func TestInstaller(t *testing.T) {
|
||||
RegisterFailHandler(Fail)
|
||||
LoadConfig(config.LuetCfg)
|
||||
// Set temporary directory for rootfs
|
||||
config.LuetCfg.GetSystem().Rootfs = "/tmp/luet-root"
|
||||
// Force dynamic path for packages cache
|
||||
config.LuetCfg.GetSystem().PkgsCachePath = ""
|
||||
RunSpecs(t, "Installer Suite")
|
||||
}
|
||||
|
Reference in New Issue
Block a user