Pegs python 2 version, removes unused imports, fixes sudden ssh dir with bad perms, generates key for sudo user as well in tests

pull/723/head
Steven Robertson 5 years ago
parent a18be5afef
commit bacc752ff2

@ -13,10 +13,10 @@ jobs:
strategy: strategy:
matrix: matrix:
Mito27_27: Mito27_27:
python.version: '2.7' python.version: '2.7.18'
MODE: mitogen MODE: mitogen
Ans288_27: Ans288_27:
python.version: '2.7' python.version: '2.7.18'
MODE: localhost_ansible MODE: localhost_ansible
VER: 2.8.8 VER: 2.8.8

@ -1,9 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
# Run tests/ansible/all.yml under Ansible and Ansible-Mitogen # Run tests/ansible/all.yml under Ansible and Ansible-Mitogen
import glob
import os import os
import shutil
import sys import sys
import ci_lib import ci_lib
@ -31,16 +29,17 @@ with ci_lib.Fold('job_setup'):
with ci_lib.Fold('machine_prep'): with ci_lib.Fold('machine_prep'):
ssh_dir = os.path.expanduser('~/.ssh') # generate a new ssh key for localhost ssh
if not os.path.exists(ssh_dir): os.system("ssh-keygen -P '' -m pem -f ~/.ssh/id_rsa")
os.makedirs(ssh_dir, int('0700', 8)) os.system("cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys")
# also generate it for the sudo user
key_path = os.path.expanduser('~/.ssh/id_rsa') os.system("sudo ssh-keygen -P '' -m pem -f /var/root/.ssh/id_rsa")
shutil.copy(KEY_PATH, key_path) os.system("sudo cat /var/root/.ssh/id_rsa.pub | sudo tee -a /var/root/.ssh/authorized_keys")
os.chmod(os.path.expanduser('~/.ssh'), int('0700', 8))
auth_path = os.path.expanduser('~/.ssh/authorized_keys') os.chmod(os.path.expanduser('~/.ssh/authorized_keys'), int('0600', 8))
os.system('ssh-keygen -y -f %s >> %s' % (key_path, auth_path)) # run chmod through sudo since it's owned by root
os.chmod(auth_path, int('0600', 8)) os.system('sudo chmod 600 /var/root/.ssh')
os.system('sudo chmod 600 /var/root/.ssh/authorized_keys')
if os.path.expanduser('~mitogen__user1') == '~mitogen__user1': if os.path.expanduser('~mitogen__user1') == '~mitogen__user1':
os.chdir(IMAGE_PREP_DIR) os.chdir(IMAGE_PREP_DIR)

@ -1,4 +1,3 @@
# Mitogen # Mitogen
<!-- [![Build Status](https://travis-ci.org/dw/mitogen.png?branch=master)](https://travis-ci.org/dw/mitogen}) --> <!-- [![Build Status](https://travis-ci.org/dw/mitogen.png?branch=master)](https://travis-ci.org/dw/mitogen}) -->

Loading…
Cancel
Save