mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 20:47:01 +01:00
minor tweaks to Orca (#2077)
This commit is contained in:
parent
66089f6426
commit
98884931c5
|
@ -16,7 +16,7 @@ echo "Also, you'll need to start the server in another tab."
|
||||||
echo ""
|
echo ""
|
||||||
echo "Hit ctrl-c to quit now if that's not what you intend!"
|
echo "Hit ctrl-c to quit now if that's not what you intend!"
|
||||||
|
|
||||||
# read -rp "Press Enter to continue"
|
read -rp "Press Enter to continue"
|
||||||
|
|
||||||
cd ../../server/daemon/ || exit 1
|
cd ../../server/daemon/ || exit 1
|
||||||
|
|
||||||
|
@ -45,9 +45,26 @@ cd "$MYDIR" || exit 1
|
||||||
|
|
||||||
LDAP_DN="DN=$(grep domain "${KANIDM_CONFIG}" | awk '{print $NF}' | tr -d '"' | sed -E 's/\./,DN=/g')"
|
LDAP_DN="DN=$(grep domain "${KANIDM_CONFIG}" | awk '{print $NF}' | tr -d '"' | sed -E 's/\./,DN=/g')"
|
||||||
|
|
||||||
|
PROFILE_PATH="/tmp/kanidm/orca.toml"
|
||||||
|
|
||||||
cargo run --bin orca -- configure \
|
cargo run --bin orca -- configure \
|
||||||
--profile /tmp/kanidm/orca.toml \
|
--profile "${PROFILE_PATH}" \
|
||||||
--admin-password "${ADMIN_PW}" \
|
--admin-password "${ADMIN_PW}" \
|
||||||
--kanidm-uri "$(grep origin "${KANIDM_CONFIG}" | awk '{print $NF}' | tr -d '"')" \
|
--kanidm-uri "$(grep origin "${KANIDM_CONFIG}" | awk '{print $NF}' | tr -d '"')" \
|
||||||
--ldap-uri "ldaps://$(grep domain "${KANIDM_CONFIG}" | awk '{print $NF}' | tr -d '"'):636" \
|
--ldap-uri "ldaps://$(grep domain "${KANIDM_CONFIG}" | awk '{print $NF}' | tr -d '"'):636" \
|
||||||
--ldap-base-dn "${LDAP_DN}"
|
--ldap-base-dn "${LDAP_DN}"
|
||||||
|
|
||||||
|
echo "Generating data..."
|
||||||
|
|
||||||
|
cargo run --bin orca -- generate --output /tmp/kanidm/orcatest
|
||||||
|
|
||||||
|
echo "Running connection test..."
|
||||||
|
|
||||||
|
cargo run --bin orca -- conntest --profile "${PROFILE_PATH}" kanidm
|
||||||
|
|
||||||
|
echo "Now you can run things!"
|
||||||
|
|
||||||
|
echo "To set up the environment, run:"
|
||||||
|
echo "cargo run --bin orca --release -- setup --profile /tmp/kanidm/orca.toml kanidm"
|
||||||
|
echo "cargo run --bin orca --release -- run --profile /tmp/kanidm/orca.toml kanidm search-basic"
|
||||||
|
|
||||||
|
|
|
@ -99,9 +99,16 @@ impl KaniHttpServer {
|
||||||
all_entities: &HashMap<Uuid, Entity>,
|
all_entities: &HashMap<Uuid, Entity>,
|
||||||
) -> Result<(), ()> {
|
) -> Result<(), ()> {
|
||||||
// Create all the accounts and groups
|
// Create all the accounts and groups
|
||||||
for u in targets {
|
let num_uuids = targets.len();
|
||||||
let e = all_entities.get(u).unwrap();
|
let mut current_slice = 1;
|
||||||
match e {
|
info!("Have to do {} uuids", num_uuids);
|
||||||
|
for (index, uuid) in targets.iter().enumerate() {
|
||||||
|
if num_uuids / 10 * current_slice > index {
|
||||||
|
info!("{}% complete", current_slice * 10);
|
||||||
|
current_slice += 1;
|
||||||
|
}
|
||||||
|
let entity = all_entities.get(uuid).unwrap();
|
||||||
|
match entity {
|
||||||
Entity::Account(a) => {
|
Entity::Account(a) => {
|
||||||
self.client
|
self.client
|
||||||
.idm_person_account_create(&a.name, &a.display_name)
|
.idm_person_account_create(&a.name, &a.display_name)
|
||||||
|
|
|
@ -45,7 +45,10 @@ struct RunOpt {
|
||||||
pub copt: CommonOpt,
|
pub copt: CommonOpt,
|
||||||
#[clap(name = "target")]
|
#[clap(name = "target")]
|
||||||
pub target: TargetOpt,
|
pub target: TargetOpt,
|
||||||
#[clap(name = "test-type")]
|
#[clap(
|
||||||
|
name = "test-type",
|
||||||
|
help = "Which type of test to run against this system: currently supports 'search-basic'"
|
||||||
|
)]
|
||||||
/// Which type of test to run against this system
|
/// Which type of test to run against this system
|
||||||
pub test_type: TestTypeOpt,
|
pub test_type: TestTypeOpt,
|
||||||
#[clap(value_parser, short, long = "profile")]
|
#[clap(value_parser, short, long = "profile")]
|
||||||
|
@ -67,7 +70,7 @@ struct ConfigOpt {
|
||||||
#[clap(value_parser, short, long)]
|
#[clap(value_parser, short, long)]
|
||||||
/// Update the LDAP URI
|
/// Update the LDAP URI
|
||||||
pub ldap_uri: Option<String>,
|
pub ldap_uri: Option<String>,
|
||||||
#[clap(value_parser, short = 'D', long)]
|
#[clap(value_parser, long)]
|
||||||
/// Update the LDAP base DN
|
/// Update the LDAP base DN
|
||||||
pub ldap_base_dn: Option<String>,
|
pub ldap_base_dn: Option<String>,
|
||||||
|
|
||||||
|
@ -75,7 +78,7 @@ struct ConfigOpt {
|
||||||
/// Set the configuration name
|
/// Set the configuration name
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
|
|
||||||
#[clap(value_parser, short, long)]
|
#[clap(value_parser, long)]
|
||||||
/// The data file path to update (or create)
|
/// The data file path to update (or create)
|
||||||
pub data_file: Option<String>,
|
pub data_file: Option<String>,
|
||||||
|
|
||||||
|
|
|
@ -269,6 +269,7 @@ pub(crate) async fn basic(
|
||||||
.await
|
.await
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
info!("Starting the warmup...");
|
||||||
|
|
||||||
// Tell the arbiter to start the warm up counter now.
|
// Tell the arbiter to start the warm up counter now.
|
||||||
broadcast_tx
|
broadcast_tx
|
||||||
|
@ -283,7 +284,7 @@ pub(crate) async fn basic(
|
||||||
// Now signal the workers to stop. We don't care if this fails.
|
// Now signal the workers to stop. We don't care if this fails.
|
||||||
let _ = broadcast_tx
|
let _ = broadcast_tx
|
||||||
.send(TestPhase::Shutdown)
|
.send(TestPhase::Shutdown)
|
||||||
.map_err(|_| error!("Unable to broadcast stop state change"));
|
.map_err(|_| error!("Unable to broadcast stop state change, but that's OK."));
|
||||||
|
|
||||||
// Now we can finalise our data, based on what analysis we can actually do here.
|
// Now we can finalise our data, based on what analysis we can actually do here.
|
||||||
process_raw_results(&raw_results);
|
process_raw_results(&raw_results);
|
||||||
|
|
Loading…
Reference in a new issue