summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoririna <irinagomez@us.es>2011-04-07 12:31:12 +0000
committeririna <irinagomez@us.es>2011-04-07 12:31:12 +0000
commita80bf335e67b8ba3d2975675fef81873124bcd9b (patch)
tree77eea2fcce1f2b746b8a9744037f56a6c3dd205c
parent642da21e1c81c629e8ab157e2226c50035c02689 (diff)
test de File.lib y Net.lib
git-svn-id: https://opengnsys.es/svn/branches/version1.0@1737 a21b9725-9963-47de-94b9-378ad31fedc9
-rw-r--r--client/shared/lib/engine/tests/NoModify/File1.shtest80
-rw-r--r--client/shared/lib/engine/tests/NoModify/Net1.shtest21
2 files changed, 101 insertions, 0 deletions
diff --git a/client/shared/lib/engine/tests/NoModify/File1.shtest b/client/shared/lib/engine/tests/NoModify/File1.shtest
new file mode 100644
index 00000000..c5ed051c
--- /dev/null
+++ b/client/shared/lib/engine/tests/NoModify/File1.shtest
@@ -0,0 +1,80 @@
+Test de compribación de la libreria File No modifica nada
+========================================
+Este test NECESITA LA CACHE
+
+Comprobamos que existe CACHE
+$ ls -d $OGCAC$OGIMG # Este test NECESITA LA CACHE ##############################
+/opt/opengnsys/cache/opt/opengnsys/images
+
+
+$ ogMakeDir CACHE prueba
+$ ls -d $OGCAC$OGIMG/prueba
+/opt/opengnsys/cache/opt/opengnsys/images/prueba
+
+$ touch $OGCAC$OGIMG/fichero_prueba
+$ ogCopyFile CACHE fichero_prueba CACHE prueba
+$ ls $OGCAC$OGIMG/prueba
+fichero_prueba
+
+$ ogGetPath CACHE fichero_prueba
+/opt/opengnsys/cache/opt/opengnsys/images/fichero_prueba
+
+# Si no existe el fichero
+$ ogGetPath CACHE fichero_prueba3; echo $?
+1
+
+$ ogGetParentPath CACHE fichero_prueba
+/opt/opengnsys/cache/opt/opengnsys/images
+
+# si el fichero no existe
+$ ogGetParentPath CACHE prueba/fichero_prueba3q23
+/opt/opengnsys/cache/opt/opengnsys/images/prueba
+
+# Si dir padre no existe
+$ ogGetParentPath CACHE pruebaNO/fichero_prueba3; echo $?
+1
+
+$ AUX=$(ogCalculateChecksum $OGCAC$OGIMG/fichero_prueba); AUX2=$(md5sum $OGCAC$OGIMG/fichero_prueba| cut -f1 -d\ ); if [ "$AUX" == "$AUX2" ]; then echo si; else echo no; fi
+si
+
+$ ogCompareChecksumFiles CACHE fichero_prueba CACHE prueba/fichero_prueba; echo $?
+0
+
+$ echo 333 >> $OGCAC$OGIMG/fichero_prueba2
+$ ogMakeChecksumFile CACHE fichero_prueba2
+$ ls $OGCAC$OGIMG/fichero_prueba2.sum
+/opt/opengnsys/cache/opt/opengnsys/images/fichero_prueba2.sum
+
+$ ogMakeChecksumFile CACHE prueba/fichero_prueba
+$ ogCompareChecksumFiles CACHE fichero_prueba2 CACHE prueba/fichero_prueba; echo $?
+1
+
+$ ogIsNewerFile CACHE fichero_prueba2 CACHE prueba/fichero_prueba; echo $?
+0
+
+$ ogIsNewerFile CACHE prueba/fichero_prueba CACHE fichero_prueba2; echo $?
+1
+
+$ ogIsNewerFile CACHE fichero_prueba CACHE prueba/fichero_prueba; echo $?
+1
+
+$ ogNewPath CACHE prueba2
+/opt/opengnsys/cache//opt/opengnsys/images/prueba2
+$ ls -d $OGCAC$OGIMG/prueba2
+/opt/opengnsys/cache/opt/opengnsys/images/prueba2
+
+$ ogDeleteTree CACHE prueba
+$ ls -d $OGCAC$OGIMG/prueba
+ls: cannot access /opt/opengnsys/cache/opt/opengnsys/images/prueba: No such file or directory
+
+$ ogDeleteFile CACHE fichero_prueba
+$ ls $OGCAC$OGIMG/fichero_prueba
+ls: cannot access /opt/opengnsys/cache/opt/opengnsys/images/fichero_prueba: No such file or directory
+
+# Limpiamos el directorio
+$ rm -rf $OGCAC$OGIMG/fichero_prueba2* $OGCAC$OGIMG/prueba2
+
+
+MEJORAS
+=======
+ogCompareChecksumFiles -> si no existen los ficheros de Checksum da verdadero. Deberia dar falso
diff --git a/client/shared/lib/engine/tests/NoModify/Net1.shtest b/client/shared/lib/engine/tests/NoModify/Net1.shtest
new file mode 100644
index 00000000..977b00d6
--- /dev/null
+++ b/client/shared/lib/engine/tests/NoModify/Net1.shtest
@@ -0,0 +1,21 @@
+Test para la librería Net.lib No modifica
+=========================================
+$ if [ "$(ogGetHostname)" == "$(hostname)" ] ; then echo si; else echo no; fi
+si
+
+$ if [ "$(ogGetNetInterface)" == "$(ifconfig|head -1|cut -d\ -f1 )" ]; then echo si; else echo no; fi
+si
+
+$ AUX=$(ifconfig eth0|grep 'inet addr'|cut -dB -f1|sed s/\ //g); if [ "$(ogGetIpAddress)" == "${AUX#*:}" ]; then echo si; else echo no; fi
+si
+
+$ AUX=$(ifconfig |head -1|sed s/\ //g| tr '[a-z]' '[A-Z]'); if [ "$(ogGetMacAddress)" == "${AUX##*HWADDR}" ]; then echo si; else echo no; fi
+si
+
+$ AUX=$(df|grep $OGIMG); if [ "//$(ogGetRepoIp)" == "${AUX%/ogimages*}" ]; then echo si; else echo no; fi
+si
+
+$ AUX=$(df|grep $OGIMG); if [ "//$(ogGetServerIp)" == "${AUX%/ogimages*}" ]; then echo si; else echo no; fi
+si
+
+