refs #1612 add missing client files

pull/2/head
Natalia Serrano 2025-02-26 14:18:48 +01:00
parent 524e5183d0
commit 929a915153
284 changed files with 76254 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,79 @@
include "theme"
screen {
background = "$$/background.png"
panel {
halign = center
attach_vcenter = 0
height = 19
# Flip so the cursor defaults to the main menu
direction = bottom_to_top
### Main Menu ###
panel {
height = 15
max_width = 120
margin_top = 1
class = container-body
# No need for a min width and centering panel because extended width > min width
direction = left_to_right
anchor = 1
id = __menu__
}
panel {
height = 4
width = 100%
class = container-title
direction = left_to_right
image {
image = "$$/images/txt-select.png"
attach_top = 0
attach_left = 0
}
### Tools Menu ###
image {
attach_right = 2
image = "$$/images/button-tools.png:$$/images/button-tools-hover.png"
command = "menu_popup tools_menu"
}
}
}
### Progress Bar ###
panel {
halign = center
attach_vcenter = 20
width = 80
class = progressbar-background
id = __timeout__
progressbar { }
}
}
template_menuitem {
panel {
width = 40
height = 12
parameters = "class=image.class:title=panel.text.text"
image {
attach_vcenter = 0
attach_hcenter = 0
}
panel {
attach_vcenter = 0
attach_hcenter = 0
class = text-line
text { font = "Helvetica Regular 22" }
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,21 @@
+class
{
-opengnsys { image = "$$/normal_opengnsys.png:$$/hover_opengnsys.png" }
-windows10 { image = "$$/normal_windows10.png:$$/hover_windows10.png" }
-windows7 { image = "$$/normal_windows7.png:$$/hover_windows7.png" }
-windows { image = "$$/normal_windows.png:$$/hover_windows.png" }
-elementary { image = "$$/normal_elementary.png:$$/hover_elementary.png" }
-elementaryos { image = "$$/normal_elementary.png:$$/hover_elementary.png" }
-recovery { image = "$$/normal_recovery.png:$$/hover_recovery.png" }
-shutdown { image = "$$/normal_shutdown.png:$$/hover_shutdown.png" }
-restart { image = "$$/normal_restart.png:$$/hover_restart.png" }
-linux { image = "$$/normal_linux.png:$$/hover_linux.png" }
-ubuntu { image = "$$/normal_ubuntu.png:$$/hover_ubuntu.png" }
-debian { image = "$$/normal_debian.png:$$/hover_debian.png" }
-suse { image = "$$/normal_opensuse.png:$$/hover_opensuse.png" }
-freebsd { image = "$$/normal_freebsd.png:$$/hover_freebsd.png" }
-macosx { image = "$$/normal_osx.png:$$/hover_osx.png" }
-haiku { image = "$$/normal_haiku.png:$$/hover_haiku.png" }
-image { image = "$$/normal_os.png:$$/hover_os.png" }
-os { image = "$$/normal_os.png:$$/hover_os.png" }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -0,0 +1,188 @@
tools_menu {
panel {
class = overlay
panel {
attach_hcenter = 0
attach_vcenter = 0
width = 30
panel {
class = dialog-title
image { image = "$$/images/txt-tools.png" attach_left = 0 }
}
panel {
class = dialog-body
text { class = br }
text {
text = "Toggle Mode"
command = "menu_toggle_mode"
class = text-menu-item
}
text {
text="Terminal"
command = "menu_popup term_window"
class = text-menu-item
}
text {
text = "Restart"
command = reboot
class = text-menu-item
}
text {
text = "Shutdown"
command = halt
class = text-menu-item
}
text {
text = "Help"
command = "menu_popup help"
class = text-menu-item
}
text {
text = "About"
command = "menu_popup about"
class = text-menu-item
}
}
}
}
}
about {
panel {
class = overlay
panel {
attach_hcenter = 0
attach_vcenter = 0
margin_left = 2
width = 60
panel {
class = dialog-title
image { image = "$$/images/txt-about.png" attach_left = 0 }
}
panel {
class = dialog-body
text { class = br }
text { text = "Darkness" class = "dialog-text" }
text { class = br }
text { text = "Designed & Created by LuxieRayku(luksi.reiku@gmail.com)" class = "dialog-text" }
text { text = "Darkness theme is designed to feel clean," class = "dialog-text" }
text { text = "light, modern & minimal." class = dialog-text }
text { class = br }
panel {
halign = center
class = button
command = true
text { text = OK class = button-text }
}
}
}
}
}
help {
panel {
class = overlay
panel {
attach_hcenter = 0
attach_vcenter = 0
margin_left = 2
width = 48
panel {
class = dialog-title
image { image = "$$/images/txt-help.png" attach_left = 0 }
}
panel {
class = dialog-body
text { text = "F1/h - Help" class = dialog-text }
text { text = "F2/t - Change theme" class = dialog-text }
text { text = "F3/r - Change resolution" class = dialog-text }
text { text = "F5/ctrl-x - Finish edit" class = dialog-text }
text { text = "F6 - Next window" class = dialog-text }
text { text = "F7 - Show folded items" class = dialog-text }
text { text = "F8 - Toggle between text and graphic mode" class = dialog-text }
text { text = "F9 - Shutdown" class = dialog-text }
text { text = "F10 - Reboot" class = dialog-text }
text { text = "f - Toggle between folded and unfolded mode" class = dialog-text }
text { text = "c - Open terminal" class = dialog-text }
text { text = "2 - Open two terminals" class = dialog-text }
text { text = "e - Edit current command" class = dialog-text }
text { text = "q - Quit graphic mode" class = dialog-text }
text { text = "i - Show theme information" class = dialog-text }
text { text = "n - Next item with the same class" class = dialog-text }
text { text = "w - Next windows item" class = dialog-text }
text { text = "u - Next ubuntu item" class = dialog-text }
text { text = "ESC - Exit from window or menu" class = dialog-text }
panel {
halign = center
class = button
command = true
text { text = OK class = button-text }
}
}
}
}
}
term_window {
panel {
class = terminal
width = 100%
height = 100%
term {
width=100%
height=100%
}
}
}
two_term {
panel {
width = 100%
height = 100%
direction = left_to_right
panel {
class = terminal
extend = 1
term {
width=100%
height=100%
}
}
panel {
class = terminal
extend = 1
term {
width=100%
height=100%
}
}
}
}
/*menu {
Shutdown {
class = "shutdown"
group = "group_main"
command = "halt"
}
}*/

View File

@ -0,0 +1,158 @@
+class {
### Default Elements ###
screen {
background = "#250040"
}
text {
color = "#4d0085:#ffffff"
font = "Sans Bold 16"
}
progressbar {
width = 80%
height = 4/1
color = "#ffffff:#4d0085"
}
edit {
color = "white"
}
password {
color = "white"
}
term {
color = "white"
}
### Text Styles ###
br {
text = "- "
font = "Sans Bold 16"
}
text-menu-item {
color = "white"
font = "Sans Bold 16"
}
dialog-title-text {
halign = center
color = "black"
}
dialog-text {
color = "white"
font = "Sans Bold 16"
}
button-text {
font = "Sans Bold 16"
color = "white"
}
### Panel Styles ###
text-line {
left = ",,,#0x0020:$$/images/text-line-l.png"
background = ",,,#0x0020:$$/images/dialog-bg.png"
right = ",,,#0x0020:$$/images/text-line-r.png"
}
button {
left = "$$/images/button-l.png:$$/images/button-hover-l.png"
background = "$$/images/button-bg.png:$$/images/button-hover-bg.png"
right = "$$/images/button-r.png:$$/images/button-hover-r.png"
margin_left = 2
margin_right = 2
margin_top = 3/0
margin_bottom = 3/0
}
terminal {
top_left = ",,light-gray/black,#0x2554:,,white/black,#0x250F"
top = ",,light-gray/black,#0x2550:,tiling,white/black,#0x2501"
top_right = ",,light-gray/black,#0x2557:,,white/black,#0x2513"
left = ",,light-gray/black,#0x2551:,tiling,white/black,#0x2503"
background="$$/images/000-70opaque.png"
right = ",,light-gray/black,#0x2551:,tiling,white/black,#0x2503"
bottom_left = ",,light-gray/black,#0x255A:,,white/black,#0x2517"
bottom = ",,light-gray/black,#0x2550:,tiling,white/black,#0x2501"
bottom_right = ",,light-gray/black,#0x255D:,tiling,white/black,#0x251B"
}
progressbar-background {
top_left = "$$/images/progressbar-bg-tl.png"
top = "$$/images/progressbar-bg-t.png"
top_right = "$$/images/progressbar-bg-tr.png"
left = "$$/images/progressbar-bg-l.png"
background = "$$/images/progressbar-bg.png"
right = "$$/images/progressbar-bg-r.png"
bottom_left = "$$/images/progressbar-bg-bl.png"
bottom = "$$/images/progressbar-bg-b.png"
bottom_right = "$$/images/progressbar-bg-br.png"
}
dialog {
top_left = "$$/images/dialog-tl.png"
top = "$$/images/dialog-t.png"
top_right = "$$/images/dialog-tr.png"
left = "$$/images/dialog-lr.png"
background = "$$/images/dialog-bg.png"
right = "$$/images/dialog-lr.png"
bottom_left = "$$/images/dialog-bl.png"
bottom = "$$/images/dialog-b.png"
bottom_right = "$$/images/dialog-br.png"
}
dialog-title {
top_left = "$$/images/dialog-tl.png"
top = "$$/images/dialog-t.png"
top_right = "$$/images/dialog-tr.png"
left = "$$/images/dialog-lr.png"
background = "$$/images/dialog-bg.png"
right = "$$/images/dialog-lr.png"
bottom_left = "$$/images/dialog-spacer.png"
bottom = "$$/images/dialog-spacer.png"
bottom_right = "$$/images/dialog-spacer.png"
}
dialog-body {
left = "$$/images/dialog-lr.png"
background = "$$/images/dialog-bg.png"
right = "$$/images/dialog-lr.png"
bottom_left = "$$/images/dialog-bl.png"
bottom = "$$/images/dialog-b.png"
bottom_right = "$$/images/dialog-br.png"
}
# container-title {
# top_left = "$$/images/container-title-tl.png"
# top = "$$/images/container-title-t.png"
# top_right = "$$/images/container-title-tr.png"
# left = "$$/images/container-title-l.png"
# background = "$$/images/container-title-bg.png"
# right = "$$/images/container-title-r.png"
# }
container-body {
top_left = "$$/images/container-tl.png"
top = "$$/images/container-t.png"
top_right = "$$/images/container-tr.png"
left = "$$/images/container-l.png"
background = "$$/images/container-bg.png"
right = "$$/images/container-r.png"
bottom_left = "$$/images/container-bl.png"
bottom = "$$/images/container-b.png"
bottom_right = "$$/images/container-br.png"
}
overlay {
height = 100%
width = 100%
absolute = 1
background="$$/images/000-70opaque.png"
}
}

View File

@ -0,0 +1,231 @@
include "menus"
include "../icons/hover"
include "icons/icons"
include "style"
screen {
background = "$$/background.png"
panel {
halign = center
attach_vcenter = 0
height = 19
# Flip so the cursor defaults to the main menu
direction = bottom_to_top
### Main Menu ###
panel {
min_width = 36
class = container-body
height = 14
# margin_top = 0
max_width = 128
panel {
halign = center
space = 0
direction = left_to_right
anchor = 1
id = __menu__
popup = bottom
}
}
panel {
halign = center
height = 4
min_width = 36
class = container-title
space = 0
direction = left_to_right
anchor = 1
image {
halign=center
image = "$$/images/txt-select.png"
attach_top = 2
attach_left = 2
}
### Tools Menu ###
# image {
# attach_right = 2
# image = "$$/images/button-tools.png:$$/images/button-tools-hover.png"
# command = "menu_popup tools_menu"
# }
}
}
### Progress Bar ###
panel {
halign = center
attach_bottom = 4
width = 60
class = progressbar-background
id = __timeout__
progressbar { }
}
}
template_menuitem {
panel {
width = 20
height = 10
parameters = "class=image.class:title=panel.text.text"
### Icon ###
image {
attach_vcenter = 0
attach_hcenter = 0
}
### Text ###
# panel {
# attach_vcenter = 0
# attach_hcenter = 0
# margin_left = 1
# margin_right = 1
# class = text-line
# text {}
# }
}
}
template_submenu {
panel {
class = dialog
}
}
template_subitem {
panel {
parameters = "title=text.text"
text {}
}
}
template_popup {
panel {
attach_hcenter = 0
attach_vcenter = 0
class = dialog
}
}
dialog_line {
panel {
parameters = "text=edit.text"
class = dialog
width = 60
attach_hcenter = 0
attach_vcenter = 0
edit {
lines = 1
max_lines = 1
}
}
}
dialog_edit {
panel {
parameters = "text=edit.text"
class = dialog
width = 90
attach_hcenter = 0
attach_vcenter = 0
edit {
lines = 10
}
}
}
dialog_message {
panel {
parameters = "text=text.text"
class = dialog
margin_size = 1
margin_bottom = 0
space = 1
attach_hcenter = 0
attach_vcenter = 0
text {}
panel {
class = button
command = true
halign = center
text { text = OK class = button-text }
}
}
}
dialog_password {
panel {
parameters = "username=__user__.text:password=__pass__.text"
class = dialog
margin_size = 1
margin_bottom = 0
attach_hcenter = 0
attach_vcenter = 0
panel {
direction = left_to_right
space = 1
text {
extend = 1
valign = center
text = Username
}
panel {
margin_left = 1
margin_right = 1
edit {
id = __user__
max_lines = 1
}
}
}
panel {
direction = left_to_right
space = 1
text {
extend = 1
valign = center
text = Password
}
panel {
margin_left = 1
margin_right = 1
password {
id = __pass__
}
}
}
panel {
class = button
command = true
halign = center
margin_left = 1
margin_right = 1
text {
text = OK
class = button-text
}
}
}
}
menu {
# Shutdown {
# command = "halt"
# class = "shutdown"
# }
}

View File

@ -0,0 +1,93 @@
Test de comprobacion de la librería Cache.lib y los script relacionados
=======================================================================
Este test destruye la cache
Necesita que las particiones sean tres como máximo
=================================================
$ ogUnmountCache 2>/dev/null ; df|grep cache
$ ogCreateCache 10000000 1>/dev/null 2>&1
$ AUX=$(ogListPartitions 1) ; echo ${AUX##*CACHE:} | sed s/\ .*\$//g
10000000
# Comprobamos que no esta formateada
$ ogCheckFs 1 4
OpenGnsys error: ogCheckFs: "1, 4, CACHE"
$ ogFormatCache|tail -1
ReiserFS is successfully created on /dev/sda4.
$ ogMountCache
/opt/opengnsys/cache
$ echo $OGCAC
/opt/opengnsys/cache
$ touch $OGCAC$OGIMG/lll
$ ls $OGCAC$OGIMG
lll
$ rm $OGCAC$OGIMG/lll
$ ogFindCache
1 4
$ ogGetCacheSize
10000000
$ ogDeleteCache >/dev/null 2>&1
$ ogFindCache
$ initCache 2000000 1>/dev/null 2>&1
$ touch $OGCAC$OGIMG/lll
$ ls $OGCAC$OGIMG
lll
$ rm $OGCAC$OGIMG/lll
#################################################33
# No permite unicast
#################################################33
#$ echo ooo > $OGCAC$OGIMG/_test_.img
#$ echo jjjjjjjjjjjjjjjjjjjjjjjjjjjjjj > $OGIMG/_test_.img
#$ touch $OGIMG/_test_.torrent
#$ updateCache REPO _test_ UNICAST
Comprobamos los errores de las entradas de datos
================================================
$ ogCreateCache
OpenGnsys error: ogCreateCache: ""
$ ogCreateCache -1
OpenGnsys error: ogCreateCache: "-1"
$ ogCreateCache 0
OpenGnsys error: ogCreateCache: "0"
# cuando se está usando la cuarta partitión no debe crearse la cache
#$ ogCreatePartition 1 NTFS:200000 EXT3:2000000 EXT3:2000000 NTFS:30000000
#$ ogListPartitions 1
#NTFS:200000 EXT3:2000000 EXT3:2000000 EXTENDED:20000000 LINUX-SWAP:199999
#$ ogCreateCache 1000000
#$ ogFindCache
# si hay cache no podemos
$ ogDeleteCache 1>/dev/null 2>&1
$ ogCreatePartitions 1 NTFS:200000 EXT3:2000000 EXT3:2000000 1>/dev/null 2>&1
$ ogCreateCache 1000000 1>/dev/null 2>&1
$ ogCreatePartitions 1 NTFS:200000 EXT2:2000000 EXT2:2000000 LINUX-SWAP:200000 1>/dev/null 2>&1; echo $?
1
FALTA
====
ogGetCacheSpace
updateCache
Error
=====
Al crear la cache no se comprueba si existe una cuarta particion. La machaca

View File

@ -0,0 +1,75 @@
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
$ 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

View File

@ -0,0 +1,85 @@
€jemplo de test de funciones de bloqueo de particiones e imagenes
=================================================================
# Funciones de bloqueo
$ ogLock 1 1
$ ls /var/lock/lock-dev-sda1
/var/lock/lock-dev-sda1
$ if ogIsLocked 1 1; then echo si; else echo no; fi
si
$ ls /var/lock/lock-dev-sda1
/var/lock/lock-dev-sda1
$ ogUnlock 1 1
$ if ogIsLocked 1 1; then echo si; else echo no; fi
no
$ ogLockPartition 1 1
$ if ogIsLocked 1 1; then echo si; else echo no; fi
si
$ ogUnlockPartition 1 1
$ if ogIsLocked 1 1; then echo si; else echo no; fi
no
# Es necesario desmontar para probar ogCheck
$ ogUnmount 1 1 >/dev/null 2>&1
$ ogLock 1 1
$ ogCheckFs 1 1
OpenGnsys error: ogCheckFs: "1 1"
$ ogUnlock 1 1
$ ogCheckFs 1 1 >/dev/null 2>&1; echo $?
0
# Bloqueo del repositorio
$ ogIsRepoLocked; echo $?
1
# FALTA: test bloqueo repo cuando esta bloqueado
# bloqueo de imagenes
# Creo una imagen ficticia
$ touch $OGIMG/_test_.img
$ ogLockImage REPO _test_
$ ls $OGIMG/_test_.lock
/opt/opengnsys/images/_test_.lock
$ if ogIsImageLocked REPO _test_ ; then echo si; else echo no; fi
si
$ ogUnlockImage REPO _test_
$ if ogIsImageLocked REPO _test_ ; then echo si; else echo no; fi
no
$ rm $OGIMG/_test_.*
# Comprobando los errores (FALTA)
$ ogLock
OpenGnsys error: ogLockPartition: ""
$ ogLock 1 10
OpenGnsys error: ogDiskToDev: ""
$ ogIsLocked
OpenGnsys error: ogIsLocked: ""
$ ogIsLocked 1 10
OpenGnsys error: ogDiskToDev: ""

View File

@ -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

View File

@ -0,0 +1,6 @@
Separamos los test que no modifican el cliente y los que sí lo hacen (pueden modificar la partitiones, imagenes, etc) en dos directorios distintos.
Ademas los numeramos diferentes por si los queremos mover de sitio:
Los test acabados en 1x no modifican nada
Los test acabados en 2x modifican el cliente

View File

@ -0,0 +1,160 @@
#!/bin/bash
# Descripcion: Crea un test no destructivo de la libreria Disk.lib conficurandolo
# para un cliente concreto.
# Se ejecuta en el servidor y el test creado se utiliza en el cliente
# Los datos los toma de la base de administración.
# Uso: creaTestDisk1 NombreCliente
#
# Falta: la bd no tiene información de las particiones lógicas (el script sí esta preparado para ellas)
# la bd no tiene datos del tamaño del disco
# Variables.
PROG=$(basename $0)
OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
SERVERCONF=$OPENGNSYS/etc/ogAdmServer.cfg
TESTDIR="$OPENGNSYS/client/lib/engine/tests/NoModify"
TESTFILE="$TESTDIR/Disk1-$1.shtest "
# Control básico de errores.
if [ $# -ne 1 ]; then
echo "$PROG: Error de ejecución"
echo "Formato: $PROG NOMBRE_PC"
exit 1
fi
# Obtener datos de acceso a la Base de datos.
source $SERVERCONF
# Comprobar si se recibe nombre de aula o de equipo.
PARTICIONES=$(mysql -u "$USUARIO" -p"$PASSWORD" -D "$CATALOG" -N -e \
"SELECT ordenadores_particiones.numpar, tipospar.tipopar, ordenadores_particiones.tamano
FROM tipospar INNER JOIN ordenadores_particiones INNER JOIN ordenadores
WHERE tipospar.codpar=ordenadores_particiones.codpar
AND ordenadores.idordenador=ordenadores_particiones.idordenador
AND nombreordenador='$1'
ORDER By ordenadores_particiones.numpar;")
# Si la cadena esta vacia, error
if [ -z "$PARTICIONES" ]; then
echo "El equipo $1 no existe en la base de datos"
exit 2
fi
# Ejemplo para añadir partitiones lógicas
#PARTICIONES="$PARTICIONES 5 LINUX-SWAP 1999999"
PRI=$( echo ${PARTICIONES%%\ 5\ *}|awk '{print $2"_"$3" "$5"_"$6" "$8"_"$9" "$11"_"$12}' |sed s/\ _//g |sed s/\ //g)
if $(echo $PARTICIONES |grep " 5 " >/dev/null); then
LOG=$( echo ${PARTICIONES##*\ 5\ }|awk '{print $1"_"$2" "$4"_"$5" "$7"_"$8" "$10"_"$11" "}' |sed s/\ _//g |sed s/\ //g)
else
LOG=""
fi
AUX=$(echo $PARTICIONES| wc -w)
let NUMPART=AUX/3
P1SIZE=$(echo $PARTICIONES|cut -d\ -f3)
P1TYPE=$(echo $PARTICIONES|cut -d\ -f2)
case "$P1TYPE" in
EMPTY) P1ID=0 ;;
FAT12) P1ID=1 ;;
EXTENDED) P1ID=5 ;;
FAT16) P1ID=6 ;;
NTFS|EXFAT) P1ID=7 ;;
FAT32) P1ID=b ;;
HFAT12) P1ID=11 ;;
HFAT16) P1ID=16 ;;
HNTFS) P1ID=17 ;;
HFAT32) P1ID=1b ;;
LINUX-SWAP) P1ID=82 ;;
EXT[234]|REISERFS|REISER4|XFS|JFS)
P1ID=83 ;;
LINUX-LVM) P1ID=8e ;;
SOLARIS) P1ID=bf ;;
CACHE) P1ID=ca ;;
LINUX-RAP1ID) P1ID=fd ;;
*) P1ID="" ;;
esac
cat > $TESTFILE << EOF
Ejemplo de test funciones de particionado no destrutivo
=======================================================
# Desmontamos antes de empezar
$ ogUnmountAll 1 2>/dev/null
$ ogUnmountCache 2>/dev/null
# Cambio de formato
$ ogDevToDisk /dev/sda
1
$ ogDevToDisk /dev/sda1
1 1
$ ogDiskToDev
/dev/sda
$ ogDiskToDev 1
/dev/sda
$ ogDiskToDev 1 1
/dev/sda1
$ ogTypeToId NTFS
7
$ ogTypeToId LINUX
83
$ ogTypeToId LINUX GPT
8300
# Tamaño de disco (cuando haya informacion en la base de datos)
#$ ogGetDiskSize 1
#312571224
# Tamaño de la particion
$ ogGetPartitionSize 1 1
$P1SIZE
# Información de las particiones
$ ogListPartitions 1 | tr : _ | sed s/EXT[234]/LINUX/g | sed s/\ //g
$PRI$LOG
$ ogListPrimaryPartitions 1 | tr : _ | sed s/EXT[234]/LINUX/g | sed s/\ //g
$PRI
$ ogListLogicalPartitions 1 | tr : _ | sed s/EXT[234]/LINUX/g
$LOG
$ ogGetPartitionsNumber
$NUMPART
# Partición activa
$ ogSetPartitionActive 1 2 >/dev/null
$ ogGetPartitionActive 1
2
$ ogSetPartitionActive 1 1 >/dev/null
$ ogGetPartitionActive 1
1
# Tipo de particiones
$ ogGetPartitionId 1 1
$P1ID
# Montamos la cache al final
$ ogMountCache >/dev/null 2>&1
EOF
echo "Test creado en $TESTFILE"
echo "Las particiones logicas hay que incluirlas a mano, porque no hay información de las mismas en la base de datos."

View File

@ -0,0 +1,82 @@
#!/bin/bash
# Descripcion: Crea un test DESTRUCTIVO de los bloqueos de particiones y de imagenes
# Se ejecuta en el servidor y el test creado se utiliza en el cliente
# La imagen de prueba puede sufrir daños
# Uso: creaTestLock2 NombreImagen
# Variables.
PROG=$(basename $0)
OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
SERVERCONF=$OPENGNSYS/etc/ogAdmServer.cfg
TESTDIR="$OPENGNSYS/client/lib/engine/tests/Modify"
TESTFILE="$TESTDIR/Lock2-img$1.shtest "
# Control básico de errores.
if [ $# -ne 1 ]; then
echo "$PROG: Error de ejecución"
echo "Formato: $PROG NOMBRE_IMAGEN"
echo " La imagen de prueba puede sufrir daños"
exit 1
fi
IMG=$1
cat > $TESTFILE << EOF
Test de bloqueos Destructivos
=============================================================================
# Bloqueo de particiones
$ ogUnmountAll 1 2>/dev/null
$ ogLock 1 1
$ ogExtendFs 1 1
OpenGnsys error: ogExtendFs: "1 1"
$ ogFormatFs 1 1
OpenGnsys error: ogFormatFs: "1 1"
#############################################################################
# Los dos comandos siguientes dan error. Los comentamos por ahora
#############################################################################
#$ ogMount 1 1
#$ ogUnmount 1 1; df|grep sda1
$ ogUnlock 1 1
$ ogExtendFs 1 1 >/dev/null 2>&1; echo $?
0
$ ogFormatFs 1 1 >/dev/null 2>&1; echo $?
0
$ ogMount 1 1
/mnt/sda1
$ ogUnmount 1 1; df|grep sda1
# Bloqueo de imagenes
#############################################################################
# Los tres comandos siguientes dan error. Los comentamos por ahora
#############################################################################
#$ ogLockImage REPO $IMG
#$ ogRestoreImage REPO $IMG 1 1 >/dev/null 2>&1; echo $?
#$ ogCreateImage 1 1 REPO $IMG >/dev/null 2>&1; echo $?
$ ogUnlockImage REPO $IMG
# Lo mismo con la imagen desbloqueada.
$ ogRestoreImage REPO $IMG 1 1 >/dev/null 2>&1; echo $?
0
$ ogCreateImage 1 1 REPO $IMG >/dev/null 2>&1; echo $?
0
EOF
echo "Test creado en $TESTFILE"
echo " La imagen de $IMG prueba puede quedar dañada despues de realizar el test"
echo " Hay cinco comandos comentados porque por ahora dan error"

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More