summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml33
-rw-r--r--Makefile5
-rw-r--r--debian/control3
-rw-r--r--test/tc_byteback_snapshot.rb10
-rw-r--r--test/tc_restore.rb2
-rw-r--r--test/tc_restore_file.rb5
-rw-r--r--test/ts_byteback.rb7
7 files changed, 51 insertions, 14 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..b152e89
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,33 @@
+stages:
+ - test
+ - package
+ - publish
+
+test: &test
+ stage: test
+ image: $CI_REGISTRY/docker-images/layers:jessie-ruby
+ script:
+ - apt-get install attr ruby-ffi
+ - make test
+
+package: &package
+ image: $CI_REGISTRY/docker-images/layers:$DISTRO-deb
+ variables:
+ DISTRO: jessie
+ stage: package
+ script:
+ - package
+ artifacts:
+ paths:
+ - pkg/
+
+publish:
+ stage: publish
+ variables:
+ RSYNC_HOSTNAME: repo.bytemark.co.uk
+ tags:
+ - shell
+ script:
+ - publish
+
+
diff --git a/Makefile b/Makefile
index 6a0cb38..4fe136d 100644
--- a/Makefile
+++ b/Makefile
@@ -10,8 +10,11 @@ docs: man/byteback-prune.man man/byteback-restore.man man/byteback-backup.man
# To be written
# man/byteback-snapshot.man man/byteback-setup-client.man man/byteback-setup-client-receive.man man/byteback-receive.man
+test:
+ ruby test/ts_byteback.rb
+
clean:
$(RM) man/*.man
-.PHONY: clean docs all
+.PHONY: clean docs all test
diff --git a/debian/control b/debian/control
index 8623f60..238203c 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: ruby
Priority: optional
Maintainer: Patrick J Cherry <patrick@bytemark.co.uk>
Uploaders: Steve Kemp <steve@bytemark.co.uk>
-Build-Depends: debhelper (>= 7.0.50~), txt2man
+Build-Depends: debhelper (>= 7.0.50~), txt2man, ruby | ruby-interpreter, ruby-ffi, attr
Standards-Version: 3.9.6
# Vcs-Git:
Vcs-Browser: https://github.com/BytemarkHosting/byteback.git
@@ -12,6 +12,7 @@ Homepage: https://github.com/BytemarkHosting/byteback
Package: byteback
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter, rsync, openssh-client, ruby-ffi | libffi-ruby
+Recommends: btrfs-progs
Description: Maintenance-free client & server backup scripts for Linux
byteback encapsulates Bytemark's "best practice" for maintenance-free backups
with easy client and server setup.
diff --git a/test/tc_byteback_snapshot.rb b/test/tc_byteback_snapshot.rb
index 87b6409..71f8c39 100644
--- a/test/tc_byteback_snapshot.rb
+++ b/test/tc_byteback_snapshot.rb
@@ -1,5 +1,3 @@
-$: << File.dirname(__FILE__)+"/../lib"
-
require 'test/unit'
require 'byteback/backup_directory'
require 'time'
@@ -58,7 +56,7 @@ class SnapshotTest < Test::Unit::TestCase
if biggest_offset.nil? or offsets.max > biggest_offset
biggest_offset = offsets.max
else
- puts "Oldest backup with space for #{limit} backups is #{offsets.max} days: #{offsets.join(", ")}"
+ puts "Oldest backup with space for #{limit} backups is #{offsets.max} days: #{offsets.join(", ")}" if $VERBOSE
break
end
@@ -70,7 +68,7 @@ class SnapshotTest < Test::Unit::TestCase
end
#
- # This run the same test as above, execpt with 3 hosts all competeing for space
+ # This run the same test as above, execpt with 3 hosts all competing for space
#
def test_sort_by_importance_with_multiple_hosts
start = Time.now
@@ -106,7 +104,7 @@ class SnapshotTest < Test::Unit::TestCase
if biggest_offset.nil? or offsets.max > biggest_offset
biggest_offset = offsets.max
else
- puts "Oldest backup with space for #{limit} backups and 3 hosts is #{offsets.max} days: #{offsets.join(", ")}"
+ puts "Oldest backup with space for #{limit} backups and 3 hosts is #{offsets.max} days: #{offsets.join(", ")}" if $VERBOSE
break
end
@@ -154,7 +152,7 @@ class SnapshotTest < Test::Unit::TestCase
day += 1
now += 86400
end
- puts "Oldest backup with space for #{limit} backups is #{offsets.max} days: #{offsets.join(", ")}"
+ puts "Oldest backup with space for #{limit} backups is #{offsets.max} days: #{offsets.join(", ")}" if $VERBOSE
end
end
diff --git a/test/tc_restore.rb b/test/tc_restore.rb
index 426c2b1..364c7f1 100644
--- a/test/tc_restore.rb
+++ b/test/tc_restore.rb
@@ -1,5 +1,3 @@
-$: << File.dirname(__FILE__)+"/../lib"
-
require 'test/unit'
require 'byteback/restore'
require 'tmpdir'
diff --git a/test/tc_restore_file.rb b/test/tc_restore_file.rb
index e9544f9..8284275 100644
--- a/test/tc_restore_file.rb
+++ b/test/tc_restore_file.rb
@@ -1,5 +1,3 @@
-$: << File.dirname(__FILE__)+"/../lib"
-
require 'test/unit'
require 'byteback/restore_file'
require 'tempfile'
@@ -20,8 +18,7 @@ class BytebackFileTest < Test::Unit::TestCase
end
def test_general
- f = Tempfile.new($0, @snapshot_path)
- puts f.path
+ f = Tempfile.new("restore-file-", @snapshot_path)
system("setfattr --name user.rsync.%stat -v \"41755 12,34 56:78\" #{f.path}")
b = Byteback::RestoreFile.new(f.path, @byteback_root)
assert_equal(041755, b.mode)
diff --git a/test/ts_byteback.rb b/test/ts_byteback.rb
new file mode 100644
index 0000000..ccee796
--- /dev/null
+++ b/test/ts_byteback.rb
@@ -0,0 +1,7 @@
+
+$: << File.dirname(__FILE__)
+$: << File.dirname(__FILE__)+"/../lib"
+
+require 'tc_restore.rb'
+require 'tc_restore_file.rb'
+require 'tc_byteback_snapshot.rb'