Files
my-rook-config/tests/integration/helm_test.go
T

94 lines
2.7 KiB
Go
Raw Normal View History

2017-12-29 00:33:36 -08:00
/*
Copyright 2016 The Rook Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
2017-09-19 01:10:50 -07:00
package integration
2017-08-24 14:55:01 -07:00
import (
"testing"
"github.com/coreos/pkg/capnslog"
"github.com/rook/rook/tests/framework/clients"
2017-11-10 12:03:43 -08:00
"github.com/rook/rook/tests/framework/contracts"
2017-08-24 14:55:01 -07:00
"github.com/rook/rook/tests/framework/utils"
"github.com/stretchr/testify/suite"
)
var (
hslogger = capnslog.NewPackageLogger("github.com/rook/rook", "helmSmokeTest")
)
// ***************************************************
// *** Major scenarios tested by the TestHelmSuite ***
// Setup
// - A cluster created via the Helm chart
// Monitors
// - One mon
// OSDs
// - Bluestore running on a directory
// Block
// - Create a pool in each cluster
// - Mount/unmount a block device through the dynamic provisioner
// File system
// - Create a file system via the REST API
// Object
// - Create the object store via the CRD
// ***************************************************
func TestHelmSuite(t *testing.T) {
2017-11-10 12:03:43 -08:00
s := new(HelmSuite)
defer func(s *HelmSuite) {
2017-11-21 00:37:46 -05:00
HandlePanics(recover(), s.op, s.T)
2017-11-10 12:03:43 -08:00
}(s)
suite.Run(t, s)
2017-08-24 14:55:01 -07:00
}
2017-09-19 01:10:50 -07:00
type HelmSuite struct {
2017-08-24 14:55:01 -07:00
suite.Suite
helper *clients.TestClient
2017-11-21 00:37:46 -05:00
kh *utils.K8sHelper
op contracts.Setup
2017-10-17 23:08:07 -07:00
namespace string
2017-08-24 14:55:01 -07:00
}
2017-09-19 01:10:50 -07:00
func (hs *HelmSuite) SetupSuite() {
2017-10-17 23:08:07 -07:00
hs.namespace = "helm-ns"
2017-11-21 00:37:46 -05:00
hs.op, hs.kh = NewBaseTestOperations(hs.T, hs.namespace, "bluestore", "", true, false, 3)
hs.helper = GetTestClient(hs.kh, hs.namespace, hs.op, hs.T)
2017-08-24 14:55:01 -07:00
}
2017-09-19 01:10:50 -07:00
func (hs *HelmSuite) TearDownSuite() {
2017-11-21 00:37:46 -05:00
hs.op.TearDown()
2017-08-24 14:55:01 -07:00
}
//Test to make sure all rook components are installed and Running
2017-09-19 01:10:50 -07:00
func (hs *HelmSuite) TestRookInstallViaHelm() {
2017-11-21 00:37:46 -05:00
checkIfRookClusterIsInstalled(hs.Suite, hs.kh, hs.namespace, hs.namespace, 1)
2017-08-24 14:55:01 -07:00
}
//Test BlockCreation on Rook that was installed via Helm
2017-09-19 01:10:50 -07:00
func (hs *HelmSuite) TestBlockStoreOnRookInstalledViaHelm() {
2017-11-21 00:37:46 -05:00
runBlockE2ETestLite(hs.helper, hs.kh, hs.Suite, hs.namespace)
2017-08-24 14:55:01 -07:00
}
//Test File System Creation on Rook that was installed via helm
2017-09-19 01:10:50 -07:00
func (hs *HelmSuite) TestFileStoreOnRookInstalledViaHelm() {
2017-11-21 00:37:46 -05:00
runFileE2ETestLite(hs.helper, hs.kh, hs.Suite, hs.namespace, "testfs")
2017-08-24 14:55:01 -07:00
}
//Test Object StoreCreation on Rook that was installed via helm
2017-09-19 01:10:50 -07:00
func (hs *HelmSuite) TestObjectStoreOnRookInstalledViaHelm() {
2017-11-21 00:37:46 -05:00
runObjectE2ETestLite(hs.helper, hs.kh, hs.Suite, hs.namespace, "default", 3)
2017-08-24 14:55:01 -07:00
}