Skip to content

Commit 62c44c4

Browse files
authored
Merge pull request libgit2#4211 from pks-t/pks/trusty
travis: upgrade container to Ubuntu 14.04
2 parents 7785078 + 7c8d460 commit 62c44c4

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ addons:
2929
- openssh-server
3030
- valgrind
3131

32+
dist: trusty
3233
sudo: false
3334

3435
matrix:
@@ -37,14 +38,20 @@ matrix:
3738
- os: osx
3839
compiler: gcc
3940
include:
41+
- compiler: gcc
42+
env: PRECISE=1
43+
os: linux
44+
dist: precise
4045
- compiler: gcc
4146
env: COVERITY=1
4247
os: linux
48+
dist: trusty
4349
- compiler: gcc
4450
env:
4551
- VALGRIND=1
4652
OPTIONS="-DBUILD_CLAR=ON -DBUILD_EXAMPLES=OFF -DDEBUG_POOL=ON -DCMAKE_BUILD_TYPE=Debug"
4753
os: linux
54+
dist: trusty
4855
allow_failures:
4956
- env: COVERITY=1
5057

script/cibuild.sh

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,39 @@ ctest -V -R libgit2_clar || exit $?
4343

4444
killall git-daemon
4545

46-
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
47-
echo 'PasswordAuthentication yes' | sudo tee -a /etc/sshd_config
48-
fi
49-
46+
# Set up sshd
47+
mkdir ~/sshd/
48+
cat >~/sshd/sshd_config<<-EOF
49+
Port 2222
50+
ListenAddress 0.0.0.0
51+
Protocol 2
52+
HostKey ${HOME}/sshd/id_rsa
53+
RSAAuthentication yes
54+
PasswordAuthentication yes
55+
PubkeyAuthentication yes
56+
ChallengeResponseAuthentication no
57+
# Required here as sshd will simply close connection otherwise
58+
UsePAM no
59+
EOF
60+
ssh-keygen -t rsa -f ~/sshd/id_rsa -N "" -q
61+
/usr/sbin/sshd -f ~/sshd/sshd_config
62+
63+
# Set up keys
5064
ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q
5165
cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
52-
ssh-keyscan -t rsa localhost >>~/.ssh/known_hosts
66+
while read algorithm key comment; do
67+
echo "[localhost]:2222 $algorithm $key" >>~/.ssh/known_hosts
68+
done <~/sshd/id_rsa.pub
5369

5470
# Get the fingerprint for localhost and remove the colons so we can parse it as
5571
# a hex number. The Mac version is newer so it has a different output format.
5672
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
57-
export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -E md5 -F localhost -l | tail -n 1 | cut -d ' ' -f 3 | cut -d : -f2- | tr -d :)
73+
export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -E md5 -F '[localhost]:2222' -l | tail -n 1 | cut -d ' ' -f 3 | cut -d : -f2- | tr -d :)
5874
else
59-
export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -F localhost -l | tail -n 1 | cut -d ' ' -f 2 | tr -d ':')
75+
export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -F '[localhost]:2222' -l | tail -n 1 | cut -d ' ' -f 2 | tr -d ':')
6076
fi
6177

62-
export GITTEST_REMOTE_URL="ssh://localhost/$HOME/_temp/test.git"
78+
export GITTEST_REMOTE_URL="ssh://localhost:2222/$HOME/_temp/test.git"
6379
export GITTEST_REMOTE_USER=$USER
6480
export GITTEST_REMOTE_SSH_KEY="$HOME/.ssh/id_rsa"
6581
export GITTEST_REMOTE_SSH_PUBKEY="$HOME/.ssh/id_rsa.pub"
@@ -83,6 +99,8 @@ if [ -e ./libgit2_clar ]; then
8399

84100
fi
85101

102+
killall sshd
103+
86104
export GITTEST_REMOTE_URL="https://github.com/libgit2/non-existent"
87105
export GITTEST_REMOTE_USER="libgit2test"
88106
ctest -V -R libgit2_clar-cred_callback

tests/online/clone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ void test_online_clone__ssh_cert(void)
547547
if (!_remote_ssh_fingerprint)
548548
cl_skip();
549549

550-
cl_git_fail_with(GIT_EUSER, git_clone(&g_repo, "ssh://localhost/foo", "./foo", &g_options));
550+
cl_git_fail_with(GIT_EUSER, git_clone(&g_repo, _remote_url, "./foo", &g_options));
551551
}
552552

553553
static char *read_key_file(const char *path)

0 commit comments

Comments
 (0)