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

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 33f1523397cd40c027d4d96bc511f0d122c70b3f Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Tue, 10 Nov 2020 10:44:34 +0000
Subject: [PATCH 1/2] lxd/db/storage/pools/test: Initialise
 db.StorageRemoteDriverNames in db_test package

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/db/storage_pools_test.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lxd/db/storage_pools_test.go b/lxd/db/storage_pools_test.go
index 2958900c5e..9830798068 100644
--- a/lxd/db/storage_pools_test.go
+++ b/lxd/db/storage_pools_test.go
@@ -11,6 +11,12 @@ import (
        "github.com/stretchr/testify/require"
 )
 
+func init() {
+       db.StorageRemoteDriverNames = func() []string {
+               return []string{"ceph", "cephfs"}
+       }
+}
+
 // The GetStoragePoolsLocalConfigs method returns only node-specific config 
values.
 func TestGetStoragePoolsLocalConfigs(t *testing.T) {
        cluster, cleanup := db.NewTestCluster(t)

From 7f8d26eb15ff1e5efaacc80372aa92743dbcbb1c Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Tue, 10 Nov 2020 10:46:21 +0000
Subject: [PATCH 2/2] lxd/db: Removes duplicated db.StorageRemoteDriverNames
 init from tests

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/db/instances_test.go       | 4 ----
 lxd/db/storage_volumes_test.go | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/lxd/db/instances_test.go b/lxd/db/instances_test.go
index 8922bcbe50..d6b71eb974 100644
--- a/lxd/db/instances_test.go
+++ b/lxd/db/instances_test.go
@@ -216,10 +216,6 @@ func TestInstanceList(t *testing.T) {
 }
 
 func TestCreateInstance(t *testing.T) {
-       db.StorageRemoteDriverNames = func() []string {
-               return []string{"ceph", "cephfs"}
-       }
-
        tx, cleanup := db.NewTestClusterTx(t)
        defer cleanup()
 
diff --git a/lxd/db/storage_volumes_test.go b/lxd/db/storage_volumes_test.go
index 2dd65f699b..557a23b449 100644
--- a/lxd/db/storage_volumes_test.go
+++ b/lxd/db/storage_volumes_test.go
@@ -12,10 +12,6 @@ import (
 
 // Addresses of all nodes with matching volume name are returned.
 func TestGetStorageVolumeNodes(t *testing.T) {
-       db.StorageRemoteDriverNames = func() []string {
-               return []string{"ceph", "cephfs"}
-       }
-
        tx, cleanup := db.NewTestClusterTx(t)
        defer cleanup()
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to