forked from rook/rook
Similar to the ceph crash collector daemon that generates a keyring with more restrictive privileges, the exporter should also generate and use a more limited keyring. Signed-off-by: avanthakkar <avanjohn@gmail.com>
34 lines
1.0 KiB
Go
34 lines
1.0 KiB
Go
/*
|
|
Copyright 2019 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.
|
|
*/
|
|
|
|
package nodedaemon
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCephCrashCollectorKeyringCaps(t *testing.T) {
|
|
caps := cephCrashCollectorKeyringCaps()
|
|
assert.Equal(t, caps, []string{"mon", "allow profile crash", "mgr", "allow rw"})
|
|
}
|
|
|
|
func TestExporterKeyringCaps(t *testing.T) {
|
|
caps := createExporterKeyringCaps()
|
|
assert.Equal(t, caps, []string{"mon", "allow profile ceph-exporter", "mgr", "allow r", "osd", "allow r", "mds", "allow r"})
|
|
}
|