Add Travis CI

This commit is contained in:
Julian Kornberger 2015-08-18 19:34:22 +02:00
parent e6587b1638
commit 77206a0866
4 changed files with 30 additions and 1 deletions

9
.travis.yml Normal file
View File

@ -0,0 +1,9 @@
language: go
go:
- 1.4.2
- tip
before_install:
- sudo mkdir --mode 0777 -p /var/ftp/incoming
- sudo apt-get install -qq vsftpd
- sudo cp $TRAVIS_BUILD_DIR/.vsftpd.conf /etc/vsftpd.conf
- sudo service vsftpd restart

13
.vsftpd.conf Normal file
View File

@ -0,0 +1,13 @@
# Used by Travis CI
listen=YES
write_enable=YES
dirmessage_enable=YES
secure_chroot_dir=/var/run/vsftpd/empty
anonymous_enable=YES
anon_root=/var/ftp
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_umask=022

View File

@ -1,5 +1,7 @@
# goftp # # goftp #
[![Build Status](https://travis-ci.org/jlaffaye/ftp.svg?branch=master)](https://travis-ci.org/jlaffaye/ftp)
A FTP client package for Go A FTP client package for Go
## Documentation ## ## Documentation ##

View File

@ -32,6 +32,11 @@ func TestConn(t *testing.T) {
t.Error(err) t.Error(err)
} }
err = c.ChangeDir("incoming")
if err != nil {
t.Error(err)
}
data := bytes.NewBufferString(testData) data := bytes.NewBufferString(testData)
err = c.Stor("test", data) err = c.Stor("test", data)
if err != nil { if err != nil {
@ -88,7 +93,7 @@ func TestConn(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} else { } else {
if dir != "/"+testDir { if dir != "/incoming/"+testDir {
t.Error("Wrong dir: " + dir) t.Error("Wrong dir: " + dir)
} }
} }