source: client/shared/lib/engine/tests/crearTestLock2 @ de734df

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change on this file since de734df was 51db584, checked in by irina <irinagomez@…>, 14 years ago

test de cache y bloqueos

git-svn-id: https://opengnsys.es/svn/branches/version1.0@1686 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100755
File size: 2.1 KB
Line 
1#!/bin/bash
2# Descripcion: Crea un test DESTRUCTIVO de los bloqueos de particiones y de imagenes
3#       Se ejecuta en el servidor y el test creado se utiliza en el cliente
4#       La imagen de prueba puede sufrir daños
5# Uso: creaTestLock2 NombreImagen
6
7# Variables.
8PROG=$(basename $0)
9OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
10SERVERCONF=$OPENGNSYS/etc/ogAdmServer.cfg
11TESTDIR="$OPENGNSYS/client/lib/engine/tests/Modify"
12TESTFILE="$TESTDIR/Lock2-img$1.shtest "
13# Control básico de errores.
14if [ $# -ne 1 ]; then
15        echo "$PROG: Error de ejecución"
16        echo "Formato: $PROG NOMBRE_IMAGEN"
17        echo "  La imagen de prueba puede sufrir daños"
18        exit 1
19fi
20
21IMG=$1
22
23cat > $TESTFILE << EOF
24Test de bloqueos Destructivos
25=============================================================================
26# Bloqueo de particiones
27$ ogUnmountAll 1 2>/dev/null
28
29$ ogLock 1 1
30
31$ ogExtendFs 1 1
32OpenGnSys error:  ogExtendFs:  "1 1"
33
34
35$ ogFormatFs 1 1
36OpenGnSys error:  ogFormatFs:  "1 1"
37
38#############################################################################
39# Los dos comandos siguientes dan error. Los comentamos por ahora
40#############################################################################
41#$ ogMount 1 1
42
43#$ ogUnmount 1 1; df|grep sda1
44
45$ ogUnlock 1 1
46
47$ ogExtendFs 1 1 >/dev/null 2>&1; echo $?
480
49
50$ ogFormatFs 1 1  >/dev/null 2>&1; echo $?
510
52
53$ ogMount 1 1
54/mnt/sda1
55
56$ ogUnmount 1 1; df|grep sda1
57
58# Bloqueo de imagenes
59#############################################################################
60# Los tres comandos siguientes dan error. Los comentamos por ahora
61#############################################################################
62#$ ogLockImage REPO  $IMG
63
64#$ ogRestoreImage REPO $IMG 1 1 >/dev/null 2>&1; echo $?
65
66#$ ogCreateImage 1 1 REPO $IMG >/dev/null 2>&1; echo $?
67
68
69$ ogUnlockImage REPO $IMG
70
71# Lo mismo con la imagen desbloqueada.
72
73$ ogRestoreImage REPO $IMG 1 1 >/dev/null 2>&1; echo $?
740
75
76$ ogCreateImage 1 1 REPO $IMG >/dev/null 2>&1; echo $?
770
78EOF
79
80echo "Test creado en $TESTFILE"
81echo "     La imagen de $IMG prueba puede quedar dañada despues de realizar el test"
82echo "     Hay cinco comandos comentados porque por ahora dan error"
Note: See TracBrowser for help on using the repository browser.