minor tweaks to Orca (#2077)

This commit is contained in:
James Hodgkinson 2023-09-07 19:04:54 +10:00 committed by GitHub
parent 66089f6426
commit 98884931c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 9 deletions

View file

@ -16,7 +16,7 @@ echo "Also, you'll need to start the server in another tab."
echo ""
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
@ -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')"
PROFILE_PATH="/tmp/kanidm/orca.toml"
cargo run --bin orca -- configure \
--profile /tmp/kanidm/orca.toml \
--profile "${PROFILE_PATH}" \
--admin-password "${ADMIN_PW}" \
--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-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"

View file

@ -99,9 +99,16 @@ impl KaniHttpServer {
all_entities: &HashMap<Uuid, Entity>,
) -> Result<(), ()> {
// Create all the accounts and groups
for u in targets {
let e = all_entities.get(u).unwrap();
match e {
let num_uuids = targets.len();
let mut current_slice = 1;
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) => {
self.client
.idm_person_account_create(&a.name, &a.display_name)

View file

@ -45,7 +45,10 @@ struct RunOpt {
pub copt: CommonOpt,
#[clap(name = "target")]
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
pub test_type: TestTypeOpt,
#[clap(value_parser, short, long = "profile")]
@ -67,7 +70,7 @@ struct ConfigOpt {
#[clap(value_parser, short, long)]
/// Update the LDAP URI
pub ldap_uri: Option<String>,
#[clap(value_parser, short = 'D', long)]
#[clap(value_parser, long)]
/// Update the LDAP base DN
pub ldap_base_dn: Option<String>,
@ -75,7 +78,7 @@ struct ConfigOpt {
/// Set the configuration name
pub name: Option<String>,
#[clap(value_parser, short, long)]
#[clap(value_parser, long)]
/// The data file path to update (or create)
pub data_file: Option<String>,

View file

@ -269,6 +269,7 @@ pub(crate) async fn basic(
.await
});
}
info!("Starting the warmup...");
// Tell the arbiter to start the warm up counter now.
broadcast_tx
@ -283,7 +284,7 @@ pub(crate) async fn basic(
// Now signal the workers to stop. We don't care if this fails.
let _ = broadcast_tx
.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.
process_raw_results(&raw_results);