From 77206a086653851f70d4da1d57f30673a57988df Mon Sep 17 00:00:00 2001 From: Julian Kornberger Date: Tue, 18 Aug 2015 19:34:22 +0200 Subject: [PATCH] Add Travis CI --- .travis.yml | 9 +++++++++ .vsftpd.conf | 13 +++++++++++++ README.md | 2 ++ client_test.go | 7 ++++++- 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .travis.yml create mode 100644 .vsftpd.conf diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..242d3ff --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/.vsftpd.conf b/.vsftpd.conf new file mode 100644 index 0000000..9bf9190 --- /dev/null +++ b/.vsftpd.conf @@ -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 diff --git a/README.md b/README.md index 8cfe8dc..38b6b08 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # goftp # +[![Build Status](https://travis-ci.org/jlaffaye/ftp.svg?branch=master)](https://travis-ci.org/jlaffaye/ftp) + A FTP client package for Go ## Documentation ## diff --git a/client_test.go b/client_test.go index 6b5b700..963e480 100644 --- a/client_test.go +++ b/client_test.go @@ -32,6 +32,11 @@ func TestConn(t *testing.T) { t.Error(err) } + err = c.ChangeDir("incoming") + if err != nil { + t.Error(err) + } + data := bytes.NewBufferString(testData) err = c.Stor("test", data) if err != nil { @@ -88,7 +93,7 @@ func TestConn(t *testing.T) { if err != nil { t.Error(err) } else { - if dir != "/"+testDir { + if dir != "/incoming/"+testDir { t.Error("Wrong dir: " + dir) } }