-
Notifications
You must be signed in to change notification settings - Fork 23
/
.travis.yml
54 lines (46 loc) · 2.41 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
language: python
dist: bionic
matrix:
include:
- python: 2.7.17
- python: 3.6.10
- python: 3.7.3
- python: 3.8.1
before_install:
- sudo apt-get -y install sshpass
install:
- pip install -U pip
- pip install -U pycodestyle coveralls pytest pytest-mccabe pytest-random
- if [[ $TRAVIS_PYTHON_VERSION == *"3."* ]]; then pip install -U pytest-asyncio; fi
- pip install -Ur requirements.txt
before_script:
- python -V
- cat /etc/passwd | grep home
- sudo useradd molerssh -c MolerSshTest -s /bin/bash -l -m -p `python3 -c 'import crypt; print(crypt.crypt("moler_password", "mr"))'`
- sudo useradd sshproxy -c Proxy4SshTest -s /bin/bash -l -m -p `python3 -c 'import crypt; print(crypt.crypt("proxy_password", "mr"))'`
- sudo useradd adbshell -c AdbShell4SshTest -s /bin/bash -l -m -p `python3 -c 'import crypt; print(crypt.crypt("adb_password", "mr"))'`
- cat /etc/passwd | grep home
- which scp
- sshpass -p moler_password ssh -oStrictHostKeyChecking=no molerssh@localhost pwd
- sshpass -p proxy_password ssh -oStrictHostKeyChecking=no sshproxy@localhost pwd
- sshpass -p adb_password ssh -oStrictHostKeyChecking=no adbshell@localhost pwd
- sshpass -p moler_password scp adb_simulation.sh molerssh@localhost:/home/molerssh/adb_simulation.sh
- sshpass -p moler_password ssh molerssh@localhost 'chmod +x ~/adb_simulation.sh'
- sshpass -p moler_password ssh molerssh@localhost 'echo "alias adb=~/adb_simulation.sh" >> ~/.profile'
script:
- python -m pycodestyle --statistics --count moler
- if [[ $TRAVIS_PYTHON_VERSION == *"2.7"* ]]; then python -m pytest --random -s -vv test; fi
- if [[ $TRAVIS_PYTHON_VERSION == *"3.6"* ]]; then python -m pytest -c py3pytest.ini --random --mccabe -s -vv; fi
- if [[ $TRAVIS_PYTHON_VERSION == *"3.7"* ]]; then coverage run -m pytest -c py3pytest.ini --random --mccabe -s -vv; fi
- if [[ $TRAVIS_PYTHON_VERSION == *"3.8"* ]]; then python -m pytest --mccabe -s -vv moler; fi
after_success:
- if [[ $TRAVIS_PYTHON_VERSION == *"3.7"* ]]; then coveralls; fi
- sudo userdel --remove --force molerssh
- cat /etc/passwd | grep home
after_failure:
- echo "----------------------- LOGS -----------------------"
- whoami
- pwd
- ls -lah *.log
- export LINE='------------------------------------------------------------------------------------------------'
- for log in `ls -1 *.log`; do echo $LINE; echo ---; echo --- $log; echo ---; echo $LINE; cat $log; done