-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test adding indices and pins using ssh
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from drivers.alr import init_local_crate, run_alr | ||
import os, subprocess | ||
|
||
HOST = "github.com" | ||
INDEX = "[email protected]:alire-project/test-index.git" | ||
KNOWN_HOSTS_DIRECTORY = "~/.ssh" | ||
|
||
# Test setup. | ||
os.makedirs(KNOWN_HOSTS_DIRECTORY, exist_ok=True) | ||
with open(KNOWN_HOSTS_DIRECTORY + "/known_hosts", "a+") as known_hosts: | ||
if HOST not in known_hosts.read(): | ||
host_key = subprocess.run(["ssh-keyscan", HOST], capture_output=True).stdout | ||
known_hosts.write(f"{host_key}\n") | ||
init_local_crate() | ||
|
||
# Ensure we can add an index using ssh. | ||
run_alr("index", "--name", "test", "--add", INDEX, complain_on_error=True) | ||
run_alr("index", "--check", complain_on_error=True) | ||
|
||
# Ensure we can pin a crate using ssh. | ||
run_alr("with", "libhello", "--use", "[email protected]:alire-project/libhello.git") | ||
|
||
# Test teardown. | ||
run_alr("index", "--del", "test", complain_on_error=True) | ||
|
||
print("SUCCESS") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
driver: python-script | ||
indexes: | ||
compiler_only_index: {} |