summaryrefslogtreecommitdiff
path: root/libkpod/config_test.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-01-28 05:59:50 -0500
committerMatthew Heon <matthew.heon@gmail.com>2018-01-29 08:17:58 -0500
commitd4d3f38018a68c97bd9a748ef3ba109c24743574 (patch)
treef8783ed8b78e176cc0fc1578c82ae199f5e0a07e /libkpod/config_test.go
parentb96887bcaa78e1072ccc1a06e57abafaed0a6bc6 (diff)
downloadpodman-d4d3f38018a68c97bd9a748ef3ba109c24743574.tar.gz
podman-d4d3f38018a68c97bd9a748ef3ba109c24743574.tar.bz2
podman-d4d3f38018a68c97bd9a748ef3ba109c24743574.zip
Remove libkpod. Replace runtime generation function.
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'libkpod/config_test.go')
-rw-r--r--libkpod/config_test.go54
1 files changed, 0 insertions, 54 deletions
diff --git a/libkpod/config_test.go b/libkpod/config_test.go
deleted file mode 100644
index e6820d3c0..000000000
--- a/libkpod/config_test.go
+++ /dev/null
@@ -1,54 +0,0 @@
-package libkpod
-
-import (
- "io/ioutil"
- "os"
- "testing"
-)
-
-// TestConfigToFile ensures Config.ToFile(..) encodes and writes out
-// a Config instance toa a file on disk.
-func TestConfigToFile(t *testing.T) {
- // Test with a default configuration
- c := DefaultConfig()
- tmpfile, err := ioutil.TempFile("", "config")
- if err != nil {
- t.Fatalf("Unable to create temporary file: %+v", err)
- }
- // Clean up temporary file
- defer os.Remove(tmpfile.Name())
-
- // Make the ToFile calls
- err = c.ToFile(tmpfile.Name())
- // Make sure no errors occurred while populating the file
- if err != nil {
- t.Fatalf("Unable to write to temporary file: %+v", err)
- }
-
- // Make sure the file is on disk
- if _, err := os.Stat(tmpfile.Name()); os.IsNotExist(err) {
- t.Fatalf("The config file was not written to disk: %+v", err)
- }
-}
-
-// TestConfigUpdateFromFile ensures Config.UpdateFromFile(..) properly
-// updates an already create Config instancec with new data.
-func TestConfigUpdateFromFile(t *testing.T) {
- // Test with a default configuration
- c := DefaultConfig()
- // Make the ToFile calls
- err := c.UpdateFromFile("testdata/config.toml")
- // Make sure no errors occurred while populating from the file
- if err != nil {
- t.Fatalf("Unable update config from file: %+v", err)
- }
-
- // Check fields that should have changed after UpdateFromFile
- if c.Storage != "overlay2" {
- t.Fatalf("Update failed. Storage did not change to overlay2")
- }
-
- if c.RuntimeConfig.PidsLimit != 2048 {
- t.Fatalf("Update failed. RuntimeConfig.PidsLimit did not change to 2048")
- }
-}