[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v0.9.18-24-g1727441

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Fri Feb 12 18:05:53 CET 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  172744139d9062c5f0b3be00d2f31f01d988eafc (commit)
      from  3511d5fac561b6e34b8b3e615a87567e7ee1f51b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=172744139d9062c5f0b3be00d2f31f01d988eafc
http://github.com/ceki/logback/commit/172744139d9062c5f0b3be00d2f31f01d988eafc

commit 172744139d9062c5f0b3be00d2f31f01d988eafc
Author: Ceki Gulcu <ceki at gimmel.(none)>
Date:   Fri Feb 12 18:03:03 2010 +0100

    - Ongoing work on the test bed for LBCORE-109. Unfortunately, due to the
      tight dependence on the OS, this test runs only on  Linux. Moreover,
      root priviledges are required...

diff --git a/logback-core/src/test/java/ch/qos/logback/core/FileAppenderResilienceTest.java b/logback-core/src/test/java/ch/qos/logback/core/FileAppenderResilienceTest.java
index ddf695c..545489b 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/FileAppenderResilienceTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/FileAppenderResilienceTest.java
@@ -24,6 +24,9 @@ public class FileAppenderResilienceTest {
 
   static String LONG_STR = " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
 
+  static String PATH_LOOPFS_SCRIPT = "/home/ceki/logback/logback-core/src/test/loopfs.sh";
+
+  
   enum LoopFSCommand {
     setup, shake, teardown;
   }
@@ -96,10 +99,12 @@ public class FileAppenderResilienceTest {
     System.out.println("Done go");
   }
 
+  // the loopfs script is tightly coupled with the host machine
+  // it needs to be Unix, with sudo privileges granted to the script
   Process runLoopFSScript(LoopFSCommand cmd) throws IOException,
       InterruptedException {
     ProcessBuilder pb = new ProcessBuilder();
-    pb.command("/usr/bin/sudo", "/home/ceki/loopfs.sh", cmd.toString());
+    pb.command("/usr/bin/sudo", PATH_LOOPFS_SCRIPT, cmd.toString());
     Process process = pb.start();
     return process;
   }
diff --git a/logback-core/src/test/loopfs.sh b/logback-core/src/test/loopfs.sh
new file mode 100755
index 0000000..81638a5
--- /dev/null
+++ b/logback-core/src/test/loopfs.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+IMG=/tmp/toto.img
+MNT_POINT=/mnt/loop
+LOOP_DEV=/dev/loop0
+BIG_FILE=$MNT_POINT/big
+
+SETUP_LOG=/tmp/loopfs.log
+LOG=/tmp/loopfs.log
+
+CMD=$1
+
+# ===================================
+setup()  {
+  echo setup
+  if [ -e $IMG ]; then
+    rm $IMG
+  fi 
+  if [ -e $LOG ]; then rm $LOG; fi
+  if [ -e $SETUP_LOG ]; then rm $SETUP_LOG; fi
+
+  dd if=/dev/zero of=$IMG count=1000 >> $SETUP_LOG 2>&1
+  losetup $LOOP_DEV $IMG >> $SETUP_LOG 2>&1
+  mkfs.ext2 $LOOP_DEV >> $SETUP_LOG 2>&1
+  mount $LOOP_DEV $MNT_POINT  >> $SETUP_LOG 2>&1
+  chown -R ceki:ceki $MNT_POINT
+}
+
+shake() { 
+  echo "shake"
+  declare -i i=0
+  while [ $i -lt 5 ]
+  do 
+    i+=1;  
+    sleep 0.5
+    dd if=/dev/zero of=$BIG_FILE count=1000 >> $LOG 2>&1
+    echo "dd `date`" >> $LOG
+    sleep 0.5;
+    rm $BIG_FILE >> $LOG 2>&1
+    echo "rm $BIG_FILE" >> $LOG
+  done
+}
+
+teardown()  {
+  echo teardown    
+  umount $MNT_POINT
+  losetup -d $LOOP_DEV
+}
+
+# ===========================================
+
+case $CMD in 
+  setup)
+    setup
+    ;;
+  shake)
+    shake
+    ;;
+   teardown)
+    teardown
+    ;;
+esac

-----------------------------------------------------------------------

Summary of changes:
 .../logback/core/FileAppenderResilienceTest.java   |    7 ++-
 logback-core/src/test/loopfs.sh                    |   62 ++++++++++++++++++++
 2 files changed, 68 insertions(+), 1 deletions(-)
 create mode 100755 logback-core/src/test/loopfs.sh


hooks/post-receive
-- 
Logback: the generic, reliable, fast and flexible logging framework.


More information about the logback-dev mailing list