diff --git a/extensions-utils/src/download_dependencies.rs b/extensions-utils/src/download_dependencies.rs index 5e4de66..deb8ceb 100644 --- a/extensions-utils/src/download_dependencies.rs +++ b/extensions-utils/src/download_dependencies.rs @@ -34,5 +34,11 @@ pub fn download_ic_binary(replica_rev: &str, binary_name: &str, renamed_binary_n let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); let out_path = Path::new(&manifest_dir).join(renamed_binary_name); - fs::rename(binary_name, out_path).expect("Failed to move sns"); + fs::rename(binary_name, &out_path).expect("Failed to move extension"); + #[cfg(unix)] + { + use std::os::unix::fs::PermissionsExt; + dfx_core::fs::set_permissions(&out_path, std::fs::Permissions::from_mode(0o777)) + .expect("Failed to set permissions"); + } } diff --git a/extensions-utils/src/project/import.rs b/extensions-utils/src/project/import.rs index 32dca31..8eea8dd 100644 --- a/extensions-utils/src/project/import.rs +++ b/extensions-utils/src/project/import.rs @@ -2,8 +2,6 @@ use crate::project::error::ProjectError; use dfx_core::config::model::canister_id_store; use dfx_core::config::model::canister_id_store::CanisterIds; use dfx_core::config::model::dfinity::Config; - -use hyper_rustls::ConfigBuilderExt; use reqwest::{Client, StatusCode}; use serde::Deserialize; use serde_json::{Map, Value}; diff --git a/extensions/nns/e2e/tests/nns.bash b/extensions/nns/e2e/tests/nns.bash index 428b4ce..b9f3dfa 100755 --- a/extensions/nns/e2e/tests/nns.bash +++ b/extensions/nns/e2e/tests/nns.bash @@ -22,10 +22,8 @@ teardown() { } @test "ic-nns-init binary exists and is executable" { - dfx cache install - # it panics, but still shows help - run "$(dfx cache show)/ic-nns-init" --help + run "$(dfx cache show)/extensions/nns/ic-nns-init" --help assert_failure assert_output --partial "thread 'main' panicked at 'Illegal arguments:" assert_output --partial "ic-nns-init [OPTIONS]" @@ -33,22 +31,18 @@ teardown() { assert_output --regexp '--version.*Print version information' # --version fails too - run "$(dfx cache show)/ic-nns-init" --version + run "$(dfx cache show)/extensions/nns/ic-nns-init" --version assert_failure } @test "ic-admin binary exists and is executable" { - dfx cache install - - run "$(dfx cache show)/ic-admin" --help + run "$(dfx cache show)/extensions/nns/ic-admin" --help assert_success assert_output --partial 'Common command-line options for `ic-admin`' } @test "sns binary exists and is executable" { - dfx cache install - - run "$(dfx cache show)/sns" --help + run "$(dfx cache show)/extensions/nns/sns-cli" --help assert_failure assert_output --partial "Initialize, deploy and interact with an SNS." } diff --git a/extensions/sns/e2e/tests/sns.bash b/extensions/sns/e2e/tests/sns.bash index fe10352..cd524e5 100755 --- a/extensions/sns/e2e/tests/sns.bash +++ b/extensions/sns/e2e/tests/sns.bash @@ -92,3 +92,8 @@ SNS_CONFIG_FILE_NAME="sns.yml" #dfx canister id sns_root #dfx canister id sns_swap } + +@test "sns-cli binary exists and is executable" { + run "$(dfx cache show)"/extensions/sns/sns-cli --help + assert_output --partial "Initialize, deploy and interact with an SNS" +}