Move first few integration tests to use dedicated namespaces

This commit is contained in:
Wojciech Tyczynski
2016-06-23 14:53:41 +02:00
parent 08f17fef27
commit ac270b66b7
7 changed files with 106 additions and 175 deletions

View File

@@ -239,6 +239,22 @@ func (m *MasterComponents) Stop(apiServer, rcManager bool) {
}
}
func CreateTestingNamespace(baseName string, apiserver *httptest.Server, t *testing.T) *api.Namespace {
// TODO: Create a namespace with a given basename.
// Currently we neither create the namespace nor delete all its contents at the end.
// But as long as tests are not using the same namespaces, this should work fine.
return &api.Namespace{
ObjectMeta: api.ObjectMeta{
// TODO: Once we start creating namespaces, switch to GenerateName.
Name: baseName,
},
}
}
func DeleteTestingNamespace(ns *api.Namespace, apiserver *httptest.Server, t *testing.T) {
// TODO: Remove all resources from a given namespace once we implement CreateTestingNamespace.
}
// RCFromManifest reads a .json file and returns the rc in it.
func RCFromManifest(fileName string) *api.ReplicationController {
data, err := ioutil.ReadFile(fileName)