Skip to content

Commit

Permalink
move pkg/cmd/admin/policy/modify_roles_test.go -> pkg/oc/admin/policy…
Browse files Browse the repository at this point in the history
…/modify_roles_test.go
  • Loading branch information
juanvallejo committed Nov 16, 2017
1 parent d27e531 commit 7159b54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

authorizationapi "github.com/openshift/origin/pkg/authorization/apis/authorization"
fakeauthorizationclient "github.com/openshift/origin/pkg/authorization/generated/internalclientset/fake"
"github.com/openshift/origin/pkg/oc/admin/policy"
)

func TestModifyNamedClusterRoleBinding(t *testing.T) {
Expand Down Expand Up @@ -126,11 +125,11 @@ func TestModifyNamedClusterRoleBinding(t *testing.T) {
}
for tcName, tc := range tests {
// Set up modifier options and run AddRole()
o := &policy.RoleModificationOptions{
o := &RoleModificationOptions{
RoleName: tc.inputRole,
RoleBindingName: tc.inputRoleBindingName,
Users: tc.inputSubjects,
RoleBindingAccessor: policy.NewClusterRoleBindingAccessor(fakeauthorizationclient.NewSimpleClientset(tc.existingClusterRoleBindings).Authorization()),
RoleBindingAccessor: NewClusterRoleBindingAccessor(fakeauthorizationclient.NewSimpleClientset(tc.existingClusterRoleBindings).Authorization()),
}

addRoleAndCheck(t, o, tcName, tc.expectedRoleBindingName, tc.expectedSubjects)
Expand Down Expand Up @@ -259,19 +258,19 @@ func TestModifyNamedLocalRoleBinding(t *testing.T) {
}
for tcName, tc := range tests {
// Set up modifier options and run AddRole()
o := &policy.RoleModificationOptions{
o := &RoleModificationOptions{
RoleName: tc.inputRole,
RoleBindingName: tc.inputRoleBindingName,
Users: tc.inputSubjects,
RoleNamespace: metav1.NamespaceDefault,
RoleBindingAccessor: policy.NewLocalRoleBindingAccessor(metav1.NamespaceDefault, fakeauthorizationclient.NewSimpleClientset(tc.existingRoleBindings).Authorization()),
RoleBindingAccessor: NewLocalRoleBindingAccessor(metav1.NamespaceDefault, fakeauthorizationclient.NewSimpleClientset(tc.existingRoleBindings).Authorization()),
}

addRoleAndCheck(t, o, tcName, tc.expectedRoleBindingName, tc.expectedSubjects)
}
}

func addRoleAndCheck(t *testing.T, o *policy.RoleModificationOptions, tcName, expectedName string, expectedSubjects []string) {
func addRoleAndCheck(t *testing.T, o *RoleModificationOptions, tcName, expectedName string, expectedSubjects []string) {
err := o.AddRole()
if err != nil {
t.Errorf("%s: unexpected err %v", tcName, err)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/newapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
buildapi "github.com/openshift/origin/pkg/build/apis/build"
"github.com/openshift/origin/pkg/generate"
"github.com/openshift/origin/pkg/generate/app"
"github.com/openshift/origin/pkg/generate/app/cmd"
apptest "github.com/openshift/origin/pkg/generate/app/test"
"github.com/openshift/origin/pkg/generate/dockerfile"
"github.com/openshift/origin/pkg/generate/git"
Expand All @@ -48,6 +47,7 @@ import (
imageinternalversion "github.com/openshift/origin/pkg/image/generated/internalclientset/typed/image/internalversion"
dockerregistry "github.com/openshift/origin/pkg/image/importer/dockerv1client"
clicmd "github.com/openshift/origin/pkg/oc/cli/cmd"
"github.com/openshift/origin/pkg/oc/generate/app/cmd"
routefake "github.com/openshift/origin/pkg/route/generated/internalclientset/fake"
templateapi "github.com/openshift/origin/pkg/template/apis/template"
templatefake "github.com/openshift/origin/pkg/template/generated/internalclientset/fake"
Expand Down

0 comments on commit 7159b54

Please sign in to comment.