remove test for non-standard configuration mechanism
@@ -3,73 +3,14 @@ package integration
import (
"testing"
- kapierror "k8s.io/apimachinery/pkg/api/errors"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
authorizationapi "github.com/openshift/origin/pkg/authorization/apis/authorization"
authorizationclient "github.com/openshift/origin/pkg/authorization/generated/internalclientset"
- imageclient "github.com/openshift/origin/pkg/image/generated/internalclientset"
- "github.com/openshift/origin/pkg/oc/lib/tokencmd"
- templateclient "github.com/openshift/origin/pkg/template/generated/internalclientset"
testutil "github.com/openshift/origin/test/util"
testserver "github.com/openshift/origin/test/util/server"
)
-func TestBootstrapPolicyAuthenticatedUsersAgainstOpenshiftNamespace(t *testing.T) {
- masterConfig, clusterAdminKubeConfig, err := testserver.StartTestMasterAPI()
- if err != nil {
- t.Fatalf("unexpected error: %v", err)
- }
- defer testserver.CleanupMasterEtcd(t, masterConfig)
-
- clusterAdminClientConfig, err := testutil.GetClusterAdminClientConfig(clusterAdminKubeConfig)
- if err != nil {
- t.Errorf("unexpected error: %v", err)
- }
-
- valerieClientConfig := *clusterAdminClientConfig
- valerieClientConfig.Username = ""
- valerieClientConfig.Password = ""
- valerieClientConfig.BearerToken = ""
- valerieClientConfig.CertFile = ""
- valerieClientConfig.KeyFile = ""
- valerieClientConfig.CertData = nil
- valerieClientConfig.KeyData = nil
-
- accessToken, err := tokencmd.RequestToken(&valerieClientConfig, nil, "valerie", "security!")
- if err != nil {
- t.Fatalf("unexpected error: %v", err)
- }
-
- valerieClientConfig.BearerToken = accessToken
- valerieTemplateClient := templateclient.NewForConfigOrDie(&valerieClientConfig).Template()
- valerieImageClient := imageclient.NewForConfigOrDie(&valerieClientConfig).Image()
-
- openshiftSharedResourcesNamespace := "openshift"
-
- if _, err := valerieTemplateClient.Templates(openshiftSharedResourcesNamespace).List(metav1.ListOptions{}); err != nil {
- t.Errorf("unexpected error: %v", err)
- }
- if _, err := valerieTemplateClient.Templates(metav1.NamespaceDefault).List(metav1.ListOptions{}); err == nil || !kapierror.IsForbidden(err) {
- t.Errorf("unexpected error: %v", err)
- }
-
- if _, err := valerieImageClient.ImageStreams(openshiftSharedResourcesNamespace).List(metav1.ListOptions{}); err != nil {
- t.Errorf("unexpected error: %v", err)
- }
- if _, err := valerieImageClient.ImageStreams(metav1.NamespaceDefault).List(metav1.ListOptions{}); err == nil || !kapierror.IsForbidden(err) {
- t.Errorf("unexpected error: %v", err)
- }
-
- if _, err := valerieImageClient.ImageStreamTags(openshiftSharedResourcesNamespace).Get("name:tag", metav1.GetOptions{}); !kapierror.IsNotFound(err) {
- t.Errorf("unexpected error: %v", err)
- }
- if _, err := valerieImageClient.ImageStreamTags(metav1.NamespaceDefault).Get("name:tag", metav1.GetOptions{}); err == nil || !kapierror.IsForbidden(err) {
- t.Errorf("unexpected error: %v", err)
- }
-}
-
func TestBootstrapPolicySelfSubjectAccessReviews(t *testing.T) {
masterConfig, clusterAdminKubeConfig, err := testserver.StartTestMasterAPI()
if err != nil {
