diff --git a/ncm-ceph/pom.xml b/ncm-ceph/pom.xml index ea327419f4..63642a30f0 100644 --- a/ncm-ceph/pom.xml +++ b/ncm-ceph/pom.xml @@ -59,7 +59,7 @@ rpm-maven-plugin - ceph + cephadm diff --git a/ncm-ceph/src/main/perl/Ceph/Commands.pm b/ncm-ceph/src/main/perl/Ceph/Commands.pm index 25dd940920..9165782bba 100644 --- a/ncm-ceph/src/main/perl/Ceph/Commands.pm +++ b/ncm-ceph/src/main/perl/Ceph/Commands.pm @@ -75,7 +75,8 @@ sub run_command_as_ceph sub run_ceph_command { my ($self, $command, $msg, %opts) = @_; - return $self->run_command([qw(/usr/bin/ceph -f json), @$command], $msg, %opts); + $opts{nostderr} = 1; + return $self->run_command([qw(/usr/sbin/cephadm shell ceph -f json), @$command], $msg, %opts); } # run a command prefixed with ceph-deploy and return the output (no json) diff --git a/ncm-ceph/src/test/perl/cfgdb.t b/ncm-ceph/src/test/perl/cfgdb.t index 759ef9c0ee..e06af2fd34 100644 --- a/ncm-ceph/src/test/perl/cfgdb.t +++ b/ncm-ceph/src/test/perl/cfgdb.t @@ -16,7 +16,7 @@ my $cfgdb = NCM::Component::Ceph::CfgDb->new($cl); isa_ok($cl, 'NCM::Component::Ceph::Cluster', 'got Cluster instance'); isa_ok($cfgdb, 'NCM::Component::Ceph::CfgDb', 'got CfgDb instance'); -set_desired_output("/usr/bin/ceph -f json config dump", $cfgdata::CONFJSON); +set_desired_output("/usr/sbin/cephadm shell ceph -f json config dump", $cfgdata::CONFJSON); $cfgdb->parse_profile_cfg(); cmp_deeply($cfgdb->{quattor}, \%cfgdata::PROFILE_CFG, 'profile hash correct'); diff --git a/ncm-ceph/src/test/perl/cluster-prepare.t b/ncm-ceph/src/test/perl/cluster-prepare.t index 5d0ca71e75..b8fd9c1bdc 100644 --- a/ncm-ceph/src/test/perl/cluster-prepare.t +++ b/ncm-ceph/src/test/perl/cluster-prepare.t @@ -16,7 +16,7 @@ my $gather1 = "$dpp ceph001.cubone.os"; my $gather2 = "$dpp ceph002.cubone.os"; my $gather3 = "$dpp ceph003.cubone.os"; my @gathers = ($gather1, $gather2, $gather3); -set_desired_output("/usr/bin/ceph -f json --cluster ceph status", $clusterdata::STATE); +set_desired_output("/usr/sbin/cephadm shell ceph -f json --cluster ceph status", $clusterdata::STATE); # Totally new cluster diff --git a/ncm-ceph/src/test/perl/clustermap-hash.t b/ncm-ceph/src/test/perl/clustermap-hash.t index edb38a68ee..2e6fcaa06f 100644 --- a/ncm-ceph/src/test/perl/clustermap-hash.t +++ b/ncm-ceph/src/test/perl/clustermap-hash.t @@ -16,9 +16,9 @@ my $cl = NCM::Component::Ceph::Cluster->new($cfg, $cmp, $cmp->prefix()); my $clmap = NCM::Component::Ceph::ClusterMap->new($cl); isa_ok($clmap, 'NCM::Component::Ceph::ClusterMap', 'got ClusterMap instance'); -set_desired_output("/usr/bin/ceph -f json mon dump", $clmapdata::MONJSON); -set_desired_output("/usr/bin/ceph -f json mgr dump", $clmapdata::MGRJSON); -set_desired_output("/usr/bin/ceph -f json mds stat", $clmapdata::MDSJSON); +set_desired_output("/usr/sbin/cephadm shell ceph -f json mon dump", $clmapdata::MONJSON); +set_desired_output("/usr/sbin/cephadm shell ceph -f json mgr dump", $clmapdata::MGRJSON); +set_desired_output("/usr/sbin/cephadm shell ceph -f json mds stat", $clmapdata::MDSJSON); ok($clmap->map_existing(), 'mapping existing daemons'); diff --git a/ncm-ceph/src/test/perl/config-deploy.t b/ncm-ceph/src/test/perl/config-deploy.t index 5c414ec177..7a78307b11 100644 --- a/ncm-ceph/src/test/perl/config-deploy.t +++ b/ncm-ceph/src/test/perl/config-deploy.t @@ -14,17 +14,17 @@ my $cmp = NCM::Component::Ceph::Luminous->new('ceph'); my $cl = NCM::Component::Ceph::Cluster->new($cfg, $cmp, $cmp->prefix()); my $cfgdb = NCM::Component::Ceph::CfgDb->new($cl); -set_desired_output("/usr/bin/ceph -f json config dump", $cfgdata::CONFJSON); +set_desired_output("/usr/sbin/cephadm shell ceph -f json config dump", $cfgdata::CONFJSON); my $cfgmap = $cfgdb->get_deploy_config(); cmp_deeply($cfgmap, \%cfgdata::DEPLOY_CFG, 'deploy hash correct'); ok($cl->deploy_config($cfgmap), 'config deployment ok'); -ok(get_command('/usr/bin/ceph -f json config set global op_queue wpq'), 'op_queue set'); -ok(get_command('/usr/bin/ceph -f json config set global mon_osd_down_out_subtree_limit rack'), 'subtree_limit set'); -ok(get_command('/usr/bin/ceph -f json config set mds mds_max_purge_ops_per_pg 10'), 'mds_max_purge_ops_per_pg set'); -ok(get_command('/usr/bin/ceph -f json config set mgr mgr/dashboard/server_addr localhost'), 'mgr/dashboard/server_addr set'); -ok(get_command('/usr/bin/ceph -f json config set mgr mgr/telemetry/contact me'), 'mgr/telemetry/contact set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set global op_queue wpq'), 'op_queue set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set global mon_osd_down_out_subtree_limit rack'), 'subtree_limit set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set mds mds_max_purge_ops_per_pg 10'), 'mds_max_purge_ops_per_pg set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set mgr mgr/dashboard/server_addr localhost'), 'mgr/dashboard/server_addr set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set mgr mgr/telemetry/contact me'), 'mgr/telemetry/contact set'); done_testing(); diff --git a/ncm-ceph/src/test/perl/configure.t b/ncm-ceph/src/test/perl/configure.t index 034b8ff693..58b287ef5f 100644 --- a/ncm-ceph/src/test/perl/configure.t +++ b/ncm-ceph/src/test/perl/configure.t @@ -17,14 +17,14 @@ my $cmp = NCM::Component::Ceph::Luminous->new('ceph'); # isa_ok($cmp, 'NCM::Component::ceph', 'got ncm-ceph instance'); set_desired_output($osddata::GET_CEPH_PVS_CMD, $osddata::OSD_PVS_OUT); -set_desired_output("/usr/bin/ceph -f json mon dump", $clmapdata::MONJSON); -set_desired_output("/usr/bin/ceph -f json mgr dump", $clmapdata::MGRJSON); -set_desired_output("/usr/bin/ceph -f json mds stat", $clmapdata::MDSJSON); +set_desired_output("/usr/sbin/cephadm shell ceph -f json mon dump", $clmapdata::MONJSON); +set_desired_output("/usr/sbin/cephadm shell ceph -f json mgr dump", $clmapdata::MGRJSON); +set_desired_output("/usr/sbin/cephadm shell ceph -f json mds stat", $clmapdata::MDSJSON); -set_desired_output("/usr/bin/ceph -f json config dump",'[]'); +set_desired_output("/usr/sbin/cephadm shell ceph -f json config dump",'[]'); -set_desired_output('/usr/bin/ceph -f json --version', $clusterdata::CEPH_VERSION); -set_desired_output('/usr/bin/ceph -f json osd dump --id bootstrap-osd', $osddata::OSD_DUMP); +set_desired_output('/usr/sbin/cephadm shell ceph -f json --version', $clusterdata::CEPH_VERSION); +set_desired_output('/usr/sbin/cephadm shell ceph -f json osd dump --id bootstrap-osd', $osddata::OSD_DUMP); set_file_contents($osddata::BOOTSTRAP_OSD_KEYRING, 'key'); set_file_contents($osddata::BOOTSTRAP_OSD_KEYRING_SL, 'key'); diff --git a/ncm-ceph/src/test/perl/oct-cfgdb.t b/ncm-ceph/src/test/perl/oct-cfgdb.t index 3a32f04bcf..032b52e06c 100644 --- a/ncm-ceph/src/test/perl/oct-cfgdb.t +++ b/ncm-ceph/src/test/perl/oct-cfgdb.t @@ -16,7 +16,7 @@ my $cfgdb = NCM::Component::Ceph::CfgDb->new($cl, $cl->{tree}->{configdb}); isa_ok($cl, 'NCM::Component::Ceph::Orchestrator', 'got Orchestrator instance'); isa_ok($cfgdb, 'NCM::Component::Ceph::CfgDb', 'got CfgDb instance'); -set_desired_output("/usr/bin/ceph -f json config dump", $cfgdata::CONFJSON); +set_desired_output("/usr/sbin/cephadm shell ceph -f json config dump", $cfgdata::CONFJSON); $cfgdb->parse_profile_cfg(); cmp_deeply($cfgdb->{quattor}, \%cfgdata::PROFILE_CFG, 'profile hash correct'); @@ -32,9 +32,9 @@ cmp_deeply($cfgmap, \%cfgdata::DEPLOY_CFG, 'deploy hash correct'); ok($cl->deploy_config($cfgmap), 'config deployment ok'); -ok(get_command('/usr/bin/ceph -f json config set global op_queue wpq'), 'op_queue set'); -ok(get_command('/usr/bin/ceph -f json config set global mon_osd_down_out_subtree_limit rack'), 'subtree_limit set'); -ok(get_command('/usr/bin/ceph -f json config set mds mds_max_purge_ops_per_pg 10'), 'mds_max_purge_ops_per_pg set'); -ok(get_command('/usr/bin/ceph -f json config set mgr mgr/dashboard/server_addr localhost'), 'mgr/dashboard/server_addr set'); -ok(get_command('/usr/bin/ceph -f json config set mgr mgr/telemetry/contact me'), 'mgr/telemetry/contact set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set global op_queue wpq'), 'op_queue set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set global mon_osd_down_out_subtree_limit rack'), 'subtree_limit set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set mds mds_max_purge_ops_per_pg 10'), 'mds_max_purge_ops_per_pg set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set mgr mgr/dashboard/server_addr localhost'), 'mgr/dashboard/server_addr set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set mgr mgr/telemetry/contact me'), 'mgr/telemetry/contact set'); done_testing(); diff --git a/ncm-ceph/src/test/perl/oct-config-deploy.t b/ncm-ceph/src/test/perl/oct-config-deploy.t index ecf8611ed6..04e7d64818 100644 --- a/ncm-ceph/src/test/perl/oct-config-deploy.t +++ b/ncm-ceph/src/test/perl/oct-config-deploy.t @@ -13,14 +13,14 @@ my $cfg = get_config_for_profile("oct_cluster"); my $cmp = NCM::Component::Ceph::Octopus->new('ceph'); my $cl = NCM::Component::Ceph::Orchestrator->new($cfg, $cmp); -set_desired_output("/usr/bin/ceph -f json config dump", $cfgdata::CONFJSON); +set_desired_output("/usr/sbin/cephadm shell ceph -f json config dump", $cfgdata::CONFJSON); ok($cl->set_config_db(), 'config deployment ok'); -ok(get_command('/usr/bin/ceph -f json config set global op_queue wpq'), 'op_queue set'); -ok(get_command('/usr/bin/ceph -f json config set global mon_osd_down_out_subtree_limit rack'), 'subtree_limit set'); -ok(get_command('/usr/bin/ceph -f json config set mds mds_max_purge_ops_per_pg 10'), 'mds_max_purge_ops_per_pg set'); -ok(get_command('/usr/bin/ceph -f json config set mgr mgr/dashboard/server_addr localhost'), 'mgr/dashboard/server_addr set'); -ok(get_command('/usr/bin/ceph -f json config set mgr mgr/telemetry/contact me'), 'mgr/telemetry/contact set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set global op_queue wpq'), 'op_queue set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set global mon_osd_down_out_subtree_limit rack'), 'subtree_limit set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set mds mds_max_purge_ops_per_pg 10'), 'mds_max_purge_ops_per_pg set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set mgr mgr/dashboard/server_addr localhost'), 'mgr/dashboard/server_addr set'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json config set mgr mgr/telemetry/contact me'), 'mgr/telemetry/contact set'); done_testing(); diff --git a/ncm-ceph/src/test/perl/oct-configure.t b/ncm-ceph/src/test/perl/oct-configure.t index af1e441aeb..bc70b9f13e 100644 --- a/ncm-ceph/src/test/perl/oct-configure.t +++ b/ncm-ceph/src/test/perl/oct-configure.t @@ -15,9 +15,9 @@ my $cmp = NCM::Component::Ceph::Octopus->new('ceph'); isa_ok($cmp, 'NCM::Component::Ceph::Octopus', 'got ncm-ceph instance'); -set_desired_output('/usr/bin/ceph -f json --version', $clusterdata::CEPH_VERSION_OCT); -set_desired_output('/usr/bin/ceph -f json orch host ls', $orchdata::HOSTS_JSON); -set_desired_output("/usr/bin/ceph -f json config dump",'[]'); +set_desired_output('/usr/sbin/cephadm shell ceph -f json --version', $clusterdata::CEPH_VERSION_OCT); +set_desired_output('/usr/sbin/cephadm shell ceph -f json orch host ls', $orchdata::HOSTS_JSON); +set_desired_output("/usr/sbin/cephadm shell ceph -f json config dump",'[]'); ok($cmp->Configure($cfg), 'Ceph component configure ok'); diff --git a/ncm-ceph/src/test/perl/octdata.pm b/ncm-ceph/src/test/perl/octdata.pm index 0392b3eedb..d8e34bff29 100644 --- a/ncm-ceph/src/test/perl/octdata.pm +++ b/ncm-ceph/src/test/perl/octdata.pm @@ -1,4 +1,4 @@ -set_desired_output('/usr/bin/ceph -f json --version', $clusterdata::CEPH_VERSION); +set_desired_output('/usr/sbin/cephadm shell ceph -f json --version', $clusterdata::CEPH_VERSION); diff --git a/ncm-ceph/src/test/perl/orch-apply.t b/ncm-ceph/src/test/perl/orch-apply.t index c698fd3f53..9d948d86c1 100644 --- a/ncm-ceph/src/test/perl/orch-apply.t +++ b/ncm-ceph/src/test/perl/orch-apply.t @@ -17,7 +17,7 @@ isa_ok($cl, 'NCM::Component::Ceph::Orchestrator', 'got Orchestrator instance'); ok($cl->deploy_orch_section("mon"), 'deployed orch section mon ok'); my $fh = get_file('/etc/ceph/orch_mon.yaml'); is("$fh", $orchdata::MON_YAML, 'mon yaml cfgfile ok'); - ok(get_command('/usr/bin/ceph -f json orch apply -i /etc/ceph/orch_mon.yaml'), 'applied mon config'); + ok(get_command('/usr/sbin/cephadm shell ceph -f json orch apply -i /etc/ceph/orch_mon.yaml'), 'applied mon config'); ok($cl->deploy_orch_section("mgr"), 'deployed orch section mgr ok'); $fh = get_file('/etc/ceph/orch_mgr.yaml'); @@ -30,11 +30,11 @@ is("$fh", $orchdata::MDS_YAML, 'mds yaml cfgfile ok'); ok($cl->deploy_orch_section("osd"), 'deployed orch section osd ok'); $fh = get_file('/etc/ceph/orch_osd.yaml'); is("$fh", $orchdata::OSD_YAML, 'osd yaml cfgfile ok'); -ok(get_command('/usr/bin/ceph -f json orch apply -i /etc/ceph/orch_osd.yaml'), 'applied osd config'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json orch apply -i /etc/ceph/orch_osd.yaml'), 'applied osd config'); ok($cl->deploy_orch_section("hosts"), 'deployed orch section hosts ok'); $fh = get_file('/etc/ceph/orch_hosts.yaml'); is("$fh", $orchdata::HOSTS_YAML, 'hosts yaml cfgfile ok'); - ok(get_command('/usr/bin/ceph -f json orch apply -i /etc/ceph/orch_hosts.yaml'), 'applied hosts config'); + ok(get_command('/usr/sbin/cephadm shell ceph -f json orch apply -i /etc/ceph/orch_hosts.yaml'), 'applied hosts config'); done_testing(); diff --git a/ncm-ceph/src/test/perl/osddata.pm b/ncm-ceph/src/test/perl/osddata.pm index 4fb4c45426..4af327ecd8 100644 --- a/ncm-ceph/src/test/perl/osddata.pm +++ b/ncm-ceph/src/test/perl/osddata.pm @@ -8,7 +8,7 @@ use Readonly; Readonly our $BOOTSTRAP_OSD_KEYRING => '/var/lib/ceph/bootstrap-osd/ceph.keyring'; Readonly our $BOOTSTRAP_OSD_KEYRING_SL => '/etc/ceph/ceph.client.bootstrap-osd.keyring'; Readonly our $GET_CEPH_PVS_CMD => 'pvs -o pv_name,lv_tags --no-headings --reportformat json'; -Readonly our $CRUSH => '/usr/bin/ceph -f json osd crush'; +Readonly our $CRUSH => '/usr/sbin/cephadm shell ceph -f json osd crush'; Readonly our $OSD_PVS_OUT => <new($cfg, $obj, $cmp->prefix()); isa_ok($cl, 'NCM::Component::Ceph::OSDserver', 'got OSDserver instance'); set_desired_output($osddata::GET_CEPH_PVS_CMD, $osddata::OSD_PVS_OUT); -set_desired_output('/usr/bin/ceph -f json osd dump --id bootstrap-osd', $osddata::OSD_DUMP); +set_desired_output('/usr/sbin/cephadm shell ceph -f json osd dump --id bootstrap-osd', $osddata::OSD_DUMP); set_command_status("$osddata::CRUSH set-device-class special osd.24 --name osd.24", 1); diff --git a/ncm-ceph/src/test/perl/osdserver-deploy.t b/ncm-ceph/src/test/perl/osdserver-deploy.t index 7f8068e140..a1f9ed052d 100644 --- a/ncm-ceph/src/test/perl/osdserver-deploy.t +++ b/ncm-ceph/src/test/perl/osdserver-deploy.t @@ -20,10 +20,10 @@ ok(!$cl->is_node_healthy(), 'node not healthy'); set_file_contents($osddata::BOOTSTRAP_OSD_KEYRING, 'key'); set_file_contents($osddata::BOOTSTRAP_OSD_KEYRING_SL, 'key'); ok($cl->is_node_healthy(), 'node healthy'); -ok(get_command('/usr/bin/ceph -f json status --id bootstrap-osd'), 'ran cluster health command'); +ok(get_command('/usr/sbin/cephadm shell ceph -f json status --id bootstrap-osd'), 'ran cluster health command'); set_desired_output($osddata::GET_CEPH_PVS_CMD, $osddata::OSD_PVS_OUT); -set_desired_output('/usr/bin/ceph -f json osd dump --id bootstrap-osd', $osddata::OSD_DUMP); +set_desired_output('/usr/sbin/cephadm shell ceph -f json osd dump --id bootstrap-osd', $osddata::OSD_DUMP); cmp_deeply($cl->get_deployed_osds(), \%osddata::OSD_DEPLOYED, 'Deployed OSD fetched'); #diag explain $cl->get_deployed_osds();