The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/2066

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===

From 7a86bdc9cb1cb184ce4587cbc2709de0ef82d3ae Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho.ander...@canonical.com>
Date: Wed, 1 Jun 2016 12:09:04 -0600
Subject: [PATCH 1/2] PreservesInodes needs to be implemented for storageMock
 too

Signed-off-by: Tycho Andersen <tycho.ander...@canonical.com>
---
 lxd/storage_test.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lxd/storage_test.go b/lxd/storage_test.go
index eec78cc..7f0929b 100644
--- a/lxd/storage_test.go
+++ b/lxd/storage_test.go
@@ -131,6 +131,10 @@ func (s *storageMock) MigrationType() MigrationFSType {
        return MigrationFSType_RSYNC
 }
 
+func (s *storageMock) PreservesInodes() bool {
+       return false
+}
+
 func (s *storageMock) MigrationSource(container container) 
(MigrationStorageSourceDriver, error) {
        return nil, fmt.Errorf("not implemented")
 }

From b27b5e0adffa3b22d237c77b19d67190788c9775 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho.ander...@canonical.com>
Date: Wed, 1 Jun 2016 12:16:59 -0600
Subject: [PATCH 2/2] don't try to update /var/lib/lxd/containers in go tests

Signed-off-by: Tycho Andersen <tycho.ander...@canonical.com>
---
 lxd/db_update.go | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lxd/db_update.go b/lxd/db_update.go
index 0726fcf..c7e9159 100644
--- a/lxd/db_update.go
+++ b/lxd/db_update.go
@@ -17,7 +17,13 @@ import (
        log "gopkg.in/inconshreveable/log15.v2"
 )
 
-func dbUpdateFromV30(db *sql.DB) error {
+func dbUpdateFromV30(db *sql.DB, mockMode bool) error {
+       if mockMode {
+               stmt := `INSERT INTO schema (version, updated_at) VALUES (?, 
strftime("%s"));`
+               _, err := db.Exec(stmt, 31)
+               return err
+       }
+
        entries, err := ioutil.ReadDir(shared.VarPath("containers"))
        if err != nil {
                return err
@@ -1055,7 +1061,7 @@ func dbUpdate(d *Daemon, prevVersion int) error {
                }
        }
        if prevVersion < 31 {
-               err = dbUpdateFromV30(db)
+               err = dbUpdateFromV30(db, d.MockMode)
                if err != nil {
                        return err
                }
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to