AdrianSimionov 10 anni fa
parent
commit
7870c4229f
7 ha cambiato i file con 104 aggiunte e 0 eliminazioni
  1. 11 0
      .travis.yml
  2. 3 0
      README.rst
  3. 58 0
      tests/TEST_0001.sh
  4. 0 0
      tests/key
  5. BIN
      tests/test0001.cm
  6. 18 0
      tests/test0001.conf
  7. 14 0
      tests/test0001.txt

+ 11 - 0
.travis.yml

@@ -0,0 +1,11 @@
+language: c
+
+before_install:
+  - sudo apt-get update -qq
+  - sudo apt-get install -y automake libtool libsnmp-dev bison make gcc flex snmp-mibs-downloader
+  - ./autogen.sh
+
+script: 
+  - ./configure && make && sudo make install
+  - cd tests/
+  - ./TEST_0001.sh

+ 3 - 0
README.rst

@@ -1,6 +1,9 @@
 Docsis utility
 ==============
 
+.. image:: https://travis-ci.org/AdrianSimionov/docsis.svg?branch=master
+    :target: https://travis-ci.org/AdrianSimionov/docsis
+
 This program encodes a DOCSIS binary configuration file from a human-readable text configuration file.
 
 It was originaly developed at http://docsis.sourceforge.net and later on moved to https://github.com/rlaager/docsis

+ 58 - 0
tests/TEST_0001.sh

@@ -0,0 +1,58 @@
+#!/bin/bash
+
+TEST=test0001
+DOCSIS=../src/docsis
+KEYFILE=../src/keyfile
+
+$DOCSIS -e $TEST.txt $KEYFILE $TEST.cm.new
+
+if [ ! -f $TEST.cm.new ]; then
+    echo "Test $TEST failed to create CM file on first pass.";
+    exit 1;
+fi
+
+MD5SUM_1=$(md5sum $TEST.cm)
+MD5SUM_1_array=($MD5SUM_1)
+MD5SUM_2=$(md5sum $TEST.cm.new)
+MD5SUM_2_array=($MD5SUM_2)
+
+if [ "${MD5SUM_1_array[0]}" != "${MD5SUM_2_array[0]}" ]; then
+    echo "Test $TEST created a wrong CM file on first pass.";
+    exit 1;
+fi
+
+$DOCSIS -d $TEST.cm.new > $TEST.conf.new
+
+if [ ! -f $TEST.conf.new ]; then
+    echo "Test $TEST failed to create a conf file on second pass.";
+    exit 1;
+fi
+
+MD5SUM_1=$(md5sum $TEST.conf)
+MD5SUM_1_array=($MD5SUM_1)
+MD5SUM_2=$(md5sum $TEST.conf.new)
+MD5SUM_2_array=($MD5SUM_2)
+
+if [ "${MD5SUM_1_array[0]}" != "${MD5SUM_2_array[0]}" ]; then
+    echo "Test $TEST created a wrong CONF file on second pass.";
+    exit 1;
+fi
+
+$DOCSIS -e $TEST.conf.new $KEYFILE $TEST.cm.new
+
+if [ ! -f $TEST.cm.new ]; then
+    echo "Test $TEST failed to create CM file on third pass.";
+    exit 1;
+fi
+
+MD5SUM_1=$(md5sum $TEST.cm)
+MD5SUM_1_array=($MD5SUM_1)
+MD5SUM_2=$(md5sum $TEST.cm.new)
+MD5SUM_2_array=($MD5SUM_2)
+
+if [ "${MD5SUM_1_array[0]}" != "${MD5SUM_2_array[0]}" ]; then
+    echo "Test $TEST created a wrong CM file on third pass.";
+    exit 1;
+fi
+
+rm $TEST*.new

+ 0 - 0
tests/key


BIN
tests/test0001.cm


+ 18 - 0
tests/test0001.conf

@@ -0,0 +1,18 @@
+Main 
+{
+	NetworkAccess 1;
+	UsServiceFlow
+	{
+		UsServiceFlowRef 1;
+		QosParamSetType 7;
+	}
+	DsServiceFlow
+	{
+		DsServiceFlowRef 2;
+		QosParamSetType 7;
+	}
+	/* CmMic 1a3ba2e7666290b9725605718c01f967; */
+	/* CmtsMic cb5b0055aad79103519691cca2cbbe0f; */
+	/*EndOfDataMkr*/
+	/* Pad */
+}

+ 14 - 0
tests/test0001.txt

@@ -0,0 +1,14 @@
+Main 
+{
+NetworkAccess 1;
+UsServiceFlow
+{
+UsServiceFlowRef 1;
+QosParamSetType 7;
+}
+DsServiceFlow
+{
+DsServiceFlowRef 2;
+QosParamSetType 7;
+}
+}