summaryrefslogtreecommitdiff
path: root/libpod/sql_state_test.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-01-15 11:21:30 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-15 19:50:59 +0000
commit2e48c60bc5f7eb6b301c696f9e4c1cabaf1ec4aa (patch)
treec2daf7eaa83968f841c0b10ff5cd266eed439f4f /libpod/sql_state_test.go
parent2bfb31ddf4b7f28a67ef94b8b318536c367a663b (diff)
downloadpodman-2e48c60bc5f7eb6b301c696f9e4c1cabaf1ec4aa.tar.gz
podman-2e48c60bc5f7eb6b301c696f9e4c1cabaf1ec4aa.tar.bz2
podman-2e48c60bc5f7eb6b301c696f9e4c1cabaf1ec4aa.zip
Add DNS and security fields to DB
Also moves port mappings out of the SQL DB and into a file on disk. These could get very sizable (hundred to thousands of ports) so moving them out to a file will keep the DB small and fast. Finally, add a foreign key reference from container ID to container state ID. This ensures we never get into an inconsistent state where we have data in one table but not the other. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #225 Approved by: baude
Diffstat (limited to 'libpod/sql_state_test.go')
-rw-r--r--libpod/sql_state_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/libpod/sql_state_test.go b/libpod/sql_state_test.go
index 020e2ce40..19d5da63e 100644
--- a/libpod/sql_state_test.go
+++ b/libpod/sql_state_test.go
@@ -3,6 +3,7 @@ package libpod
import (
"encoding/json"
"io/ioutil"
+ "net"
"os"
"path/filepath"
"reflect"
@@ -10,6 +11,7 @@ import (
"time"
"github.com/containers/storage"
+ "github.com/cri-o/ocicni/pkg/ocicni"
"github.com/opencontainers/runtime-tools/generate"
"github.com/stretchr/testify/assert"
)
@@ -29,6 +31,24 @@ func getTestContainer(id, name, locksDir string) (*Container, error) {
StopSignal: 0,
StopTimeout: 0,
CreatedTime: time.Now(),
+ Privileged: true,
+ Mounts: []string{"/does/not/exist"},
+ DNSServer: []net.IP{net.ParseIP("192.168.1.1"), net.ParseIP("192.168.2.2")},
+ DNSSearch: []string{"example.com", "example.example.com"},
+ PortMappings: []ocicni.PortMapping{
+ {
+ HostPort: 80,
+ ContainerPort: 90,
+ Protocol: "tcp",
+ HostIP: "192.168.3.3",
+ },
+ {
+ HostPort: 100,
+ ContainerPort: 110,
+ Protocol: "udp",
+ HostIP: "192.168.4.4",
+ },
+ },
},
state: &containerRuntimeInfo{
State: ContainerStateRunning,