| 1 |
""" |
| 2 |
Tests that the "trusted repos" list is applied |
| 3 |
""" |
| 4 |
|
| 5 |
from drivers.alr import run_alr |
| 6 |
from drivers.asserts import assert_match |
| 7 |
|
| 8 |
# Try with obvious bad site and slight variations before/after |
| 9 |
for domain in ["badsite.com", "ggithub.com", "github.comm"]: |
| 10 |
p = run_alr("publish", f"http://{domain}/repo.git", |
| 11 |
"deadbeefdeadbeefdeadbeefdeadbeefdeadbeef", |
| 12 |
complain_on_error=False) |
| 13 |
assert_match(f".*Origin is hosted on unknown site: {domain}.*", p.out) |
| 14 |
|
| 15 |
# Try that having credentials doesn't interfere with the previous check and |
| 16 |
# that the domain was recognized properly |
| 17 |
for domain in ["badsite.com", "ggithub.com", "github.comm"]: |
| 18 |
for creds in ["user", "user:passwd"]: |
| 19 |
p = run_alr("publish", f"http://{creds}@{domain}/repo.git", |
| 20 |
"deadbeefdeadbeefdeadbeefdeadbeefdeadbeef", |
| 21 |
complain_on_error=False) |
| 22 |
assert_match(f".*Origin is hosted on unknown site: {domain}.*", p.out) |
| 23 |
|
| 24 |
print('SUCCESS') |