-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.sh
executable file
·75 lines (59 loc) · 1.9 KB
/
tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
##########################################
## Fichier de tests de la commande taar ##
##########################################
clear
echo "--------------------------------------"
echo "----- Tests sur la commande taar -----"
echo "--------------------------------------"
echo ""
echo "À chaque étape, lorsque le curseur clignote, appuyez sur Entrée pour continuer."
echo ""
echo "Pour réaliser les tests, nous nous servirons d'une archive TAR contenant quelques fichiers."
echo "\"test.tar\" contenant deux images, deux documents PDF et un executable."
echo ""
echo "--- Compilation : ---"
cd src
make
read -p ""
echo ""
echo "--- Affichage de l'aide ---------"
echo "--- Option -h -------------------"
echo "--- Commande : ./taar -h --------"
./taar -h
read -p ""
echo ""
echo "--- Listage des fichier de l'archive -----"
echo "--- Option -t ----------------------------"
echo "--- Commande : ./taar -t test.tar --------"
./taar -t ../test.tar
read -p ""
echo ""
echo "--- Extraction des fichier de l'archive ----------"
echo "--- Option -x ------------------------------------"
echo "--- Commande : ./taar -x test.tar sortie/ --------"
mkdir -p ../sortie
rm -f ../sortie/*
./taar -x ../test.tar ../sortie/
echo ""
echo "--- Vérification ---------------------------------"
echo "--- Commande : ls -Fl sortie/ --------------------"
ls -Fl ../sortie
read -p ""
echo ""
echo "--- Compression de l'archive -------------"
echo "--- Option -z ----------------------------"
echo "--- Commande : ./taar -z test.tar --------"
cp ../test.tar ../test_tmp.tar
rm -f ../test.tar.gz
./taar -z ../test.tar
mv ../test_tmp.tar ../test.tar
echo ""
echo "--- Vérification -------------------------"
echo "--- Commande : ls -Fl --------------------"
ls -Fl ../test.tar.gz
echo ""
echo "--------------------------------------"
echo "----- Fin du script de tests ! -------"
echo "--------------------------------------"
echo ""