mirror of
https://github.com/mudler/luet.git
synced 2025-09-05 01:00:44 +00:00
Use dynamic pkgs cache dir for test suite
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
package helpers
|
package helpers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
@@ -44,9 +45,12 @@ func GetSystemRepoDatabaseDirPath() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetSystemPkgsCacheDirPath() (ans string) {
|
func GetSystemPkgsCacheDirPath() (ans string) {
|
||||||
cachepath := "packages"
|
var cachepath string
|
||||||
if config.LuetCfg.GetSystem().PkgsCachePath != "" {
|
if config.LuetCfg.GetSystem().PkgsCachePath != "" {
|
||||||
cachepath = 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) {
|
if filepath.IsAbs(cachepath) {
|
||||||
|
@@ -28,5 +28,9 @@ import (
|
|||||||
func TestInstaller(t *testing.T) {
|
func TestInstaller(t *testing.T) {
|
||||||
RegisterFailHandler(Fail)
|
RegisterFailHandler(Fail)
|
||||||
LoadConfig(config.LuetCfg)
|
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")
|
RunSpecs(t, "Installer Suite")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user