Example #1
0
def test_bad_no_conf(tmpdir, cli):
    with pytest.raises(cli.Failed) as err:
        with cli(
                args=['ceph-deploy', 'mon'],
                stderr=subprocess.PIPE,
        ) as p:
            result = p.stderr.read().decode('utf-8')
    assert 'usage: ceph-deploy' in result
    assert_too_few_arguments(result)
    assert err.value.status == 2
Example #2
0
def test_bad_no_conf(tmpdir, cli):
    with pytest.raises(cli.Failed) as err:
        with cli(
            args=['ceph-deploy', 'mon'],
            stderr=subprocess.PIPE,
            ) as p:
            result = p.stderr.read().decode('utf-8')
    assert 'usage: ceph-deploy' in result
    assert_too_few_arguments(result)
    assert err.value.status == 2
Example #3
0
 def test_calamari_connect_host_required(self, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args('calamari connect'.split())
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
Example #4
0
 def test_new_mon_required(self, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args('new'.split())
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
Example #5
0
 def test_disk_prepare_host_required(self, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args('disk prepare'.split())
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
Example #6
0
 def test_valid_subcommands_with_args(self, cmd, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args(['%s' % cmd])
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
     assert 'invalid choice' not in err
Example #7
0
 def test_config_pull_host_required(self, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args('config pull'.split())
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
Example #8
0
 def test_osd_list_host_required(self, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args('osd list'.split())
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
Example #9
0
 def test_osd_create_host_required(self, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args('osd create'.split())
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
Example #10
0
 def test_config_pull_host_required(self, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args('config pull'.split())
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
Example #11
0
 def test_valid_subcommands_with_args(self, cmd, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args(['%s' % cmd])
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
     assert 'invalid choice' not in err
Example #12
0
 def test_disk_zap_host_required(self, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args('disk zap'.split())
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
Example #13
0
 def test_gatherkeys_host_required(self, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args("gatherkeys".split())
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
Example #14
0
 def test_calamari_connect_host_required(self, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args('calamari connect'.split())
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
Example #15
0
 def test_pkg_remove_host_required(self, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args('pkg --remove pkg1'.split())
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)
Example #16
0
 def test_pkg_remove_host_required(self, capsys):
     with pytest.raises(SystemExit):
         self.parser.parse_args('pkg --remove pkg1'.split())
     out, err = capsys.readouterr()
     assert_too_few_arguments(err)