]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Get torrentfs fuse test working
authorMatt Joiner <anacrolix@gmail.com>
Tue, 29 Aug 2017 04:02:30 +0000 (14:02 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 29 Aug 2017 04:02:30 +0000 (14:02 +1000)
.circleci/config.yml
fs/test.sh

index 2c864953a049113652fb84b8d33bcc52dd851923..4ae2ed28e8dea114bc32021e27cf821ff6001e71 100644 (file)
@@ -1,15 +1,25 @@
 version: 2
 jobs:
   build:
-    docker:
-      - image: circleci/golang:latest
-        environment:
-          PROJECT_GO_PACKAGE: github.com/anacrolix/torrent
-    working_directory: /go/src/$PROJECT_GO_PACKAGE
+    machine: true
+    environment:
+      PROJECT_GO_PACKAGE: github.com/anacrolix/torrent
+    # Should use PROJECT_GO_PACKAGE here but it's not interpolated for this
+    # field. https://discuss.circleci.com/t/environment-variable-expansion-in-
+    # working-directory/11322/4
+    working_directory: ~/go/src/github.com/anacrolix/torrent
     steps:
       - run: echo $PROJECT_GO_PACKAGE
+      - run: echo $CIRCLE_WORKING_DIRECTORY
+      - run: echo $PWD
+      - run: echo 'export GOPATH=$HOME/go' >> $BASH_ENV
+      - run: echo 'export PATH="$GOPATH/bin:$PATH"' >> $BASH_ENV
+      - run: echo $GOPATH
+      - run: go version
+      - run: cd /usr/local && sudo rm -r go && sudo mkdir go go1.4 && sudo chown `whoami` go go1.4 && git clone git://github.com/golang/go && cd go && git branch -f -t go1.4 origin/release-branch.go1.4 && cd .. && git clone --single-branch -b go1.4 go go1.4 && cd go1.4/src && ./make.bash && cd ../../go/src && GOROOT_BOOTSTRAP=/usr/local/go1.4 ./make.bash
+      - run: go version
       - checkout
-      - run: sudo apt install fuse
+      - run: sudo apt install fuse pv
       - run: go get -t -d -v -race $PROJECT_GO_PACKAGE/...
       - run: go test -v -race $PROJECT_GO_PACKAGE/...
       - run: CGO_ENABLED=0 go get -t -d -v $PROJECT_GO_PACKAGE/...
@@ -17,3 +27,6 @@ jobs:
       - run: go get golang.org/x/mobile/cmd/gomobile
       - run: gomobile init
       - run: gomobile build -target=android $PROJECT_GO_PACKAGE
+      - run: go get github.com/anacrolix/godo
+      - run: sudo modprobe fuse
+      - run: fs/test.sh
index 068723f946f937b9c02d7a1eea2a1f23247b8fd4..36abc1afaa87c5230a25c57a1959cc314f82385c 100755 (executable)
@@ -1,8 +1,12 @@
 mkdir mnt torrents
+umount mnt
+set -e
 GOPPROF=http godo github.com/anacrolix/torrent/cmd/torrentfs -mountDir=mnt -metainfoDir=torrents &
 cd torrents
-wget http://releases.ubuntu.com/14.04.2/ubuntu-14.04.2-desktop-amd64.iso.torrent
+wget -c https://cdimage.debian.org/debian-cd/current/amd64/bt-cd/debian-9.1.0-amd64-netinst.iso.torrent
+echo 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=sintel.mp4' > sintel.magnet
 cd ..
-file=ubuntu-14.04.2-desktop-amd64.iso
+file=debian-9.1.0-amd64-netinst.iso
+# file=sintel.mp4
 while [ ! -e "mnt/$file" ]; do sleep 1; done
 pv "mnt/$file" | md5sum