示例#1
0
 def test_podname_conn_appends(self):
     conn = kubernetes.KubernetesConnection('rook-ceph-asdf', 'rook-ceph')
     result = conn.cmd(['ceph', '--version'])
     assert result == [
         'kubectl', 'exec', '-i', '-n', 'rook-ceph',
         'rook-ceph-asdf', '--', '/bin/sh', '-c', 'ceph --version'
     ]
示例#2
0
 def test_namespace_appends(self):
     conn = kubernetes.KubernetesConnection('rook-ceph-asdf', 'rook-ceph')
     result = conn.cmd(['ceph', 'health'])
     assert result == [
         'kubectl', 'exec', '-i', '-n', 'rook-ceph',
         'rook-ceph-asdf', '--', '/bin/sh', '-c', 'ceph health'
     ]
示例#3
0
 def test_using_context_and_namespace(self):
     conn = kubernetes.KubernetesConnection('rook-ceph-asdf', 'rook-ceph', context='4')
     tmpl = conn.command_template()
     assert tmpl == [
         'kubectl', '--context', '4', 'exec', '-i', '-n', 'rook-ceph',
         'rook-ceph-asdf', '--', '/bin/sh', '-c'
     ]
示例#4
0
 def test_using_podname_only(self):
     conn = kubernetes.KubernetesConnection('rook-ceph-asdf')
     tmpl = conn.command_template()
     assert tmpl == ['kubectl', 'exec', '-i', 'rook-ceph-asdf', '--', '/bin/sh', '-c']