Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(rust): update tests using the ENROLLMENT_TICKET env var #8675

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions implementations/rust/ockam/ockam_api/src/cli_state/cli_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,21 +405,4 @@ mod tests {
.map(|f| f.unwrap().file_name().to_string_lossy().to_string())
.collect()
}

#[tokio::test]
async fn random_name_generator() {
// Same process
let mut names = Vec::new();
for _ in 0..100 {
names.push(random_name());
}
assert_eq!(names.len(), names.iter().unique().count());

// In an async context
let mut names = Vec::new();
for _ in 0..100 {
names.push(tokio::task::spawn_blocking(random_name).await.unwrap());
}
assert_eq!(names.len(), names.iter().unique().count());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,9 @@ EOF
export ENROLLMENT_TICKET=$(cat "$OCKAM_HOME/enrollment.ticket")

setup_home_dir
cat <<EOF >"$OCKAM_HOME/config.yaml"
ticket: ${ENROLLMENT_TICKET}
name: n1
EOF

run_success "$OCKAM" node create "$OCKAM_HOME/config.yaml"
# The ENROLLMENT_TICKET is parsed automatically, so the `node create` command will
# first use the ticket before creating the node
run_success "$OCKAM" node create n1
run_success "$OCKAM" node show n1

# Check that the identity can reach the project
Expand All @@ -257,12 +254,7 @@ EOF
export ENROLLMENT_TICKET=$(cat "$OCKAM_HOME/enrollment.ticket")

setup_home_dir
cat <<EOF >"$OCKAM_HOME/config.yaml"
ticket: ${ENROLLMENT_TICKET}
name: n1
EOF

run_success "$OCKAM" node create "$OCKAM_HOME/config.yaml" -f &
run_success "$OCKAM" node create n1 -f &
sleep 10
run_success "$OCKAM" node show n1

Expand Down
Loading