forked from servalproject/serval-dna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrhizomechannels
executable file
·149 lines (134 loc) · 4.12 KB
/
rhizomechannels
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/bin/bash
# Tests for Serval rhizome protocol.
#
# Copyright 2012 Serval Project, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
source "${0%/*}/../testframework.sh"
source "${0%/*}/../testdefs.sh"
source "${0%/*}/../testdefs_rhizome.sh"
shopt -s extglob
finally() {
stop_all_servald_servers
}
teardown() {
kill_all_servald_processes
assert_no_servald_processes
report_all_servald_servers
}
# Called by start_servald_instances for each instance.
configure_servald_server() {
add_servald_interface
executeOk_servald config \
set log.show_pid on \
set log.show_time on \
set debug.rhizome on \
set debug.httpd on \
set debug.rhizome_tx on \
set debug.rhizome_rx on
}
setup_common() {
setup_servald
assert_no_servald_processes
foreach_instance +A +B create_single_identity
set_instance +B
}
doc_FileTransfer0C="New bundle and update transfer to one node with no channels configured"
setup_FileTransfer0C() {
setup_common
set_instance +A
rhizome_add_file file1
start_servald_instances +A +B
foreach_instance +A assert_peers_are_instances +B
foreach_instance +B assert_peers_are_instances +A
}
test_FileTransfer0C() {
wait_until bundle_received_by $BID:$VERSION +B
set_instance +B
executeOk_servald rhizome list
assert_rhizome_list --fromhere=0 file1
assert_rhizome_received file1
set_instance +A
rhizome_update_file file1 file2
set_instance +B
wait_until bundle_received_by $BID:$VERSION +B
executeOk_servald rhizome list
assert_rhizome_list --fromhere=0 file2
assert_rhizome_received file2
}
doc_ValidChannelConfig="NOT IMPLEMENTED Valid channel configuration is accepted"
setup_ValidChannelConfig() {
assert 0
}
test_ValidChannelConfig() {
assert 0
}
doc_InvalidChannelConfig="NOT IMPLEMENTED Invalid channel configuration is rejected"
setup_InvalidChannelConfig() {
assert 0
}
test_InvalidChannelConfig() {
assert 0
}
doc_CorrectChannelsApplied="NOT IMPLEMENTED New bundles are correctly labeled with default channels"
setup_CorrectChannelsApplied() {
assert 0
}
doc_CorrectChannelsApplied() {
assert 0
}
doc_HeteroChannelLocalXFEROk="NOT IMPLEMENTED Local rhizome transfers still occur between nodes with disjoint channel lists"
setup_HeteroChannelLocalXFEROk() {
assert 0
}
test_HeteroChannelLocalXFEROk() {
assert 0
}
doc_DiscardLowPriorityChannelsFirst="NOT IMPLEMENTED Bundles for higher priority channels displace that of lower priority channels, and not vice versa"
setup_DiscardLowPriorityChannelsFirst() {
assert 0
}
test_DiscardLowPriorityChannelsFirst() {
assert 0
}
doc_HeteroChannelRDPushIsNOOP="NOT IMPLEMENTED Rhizome direct push between nodes with disjoint channel lists transfers nothing"
setup_HeteroChannelRDPushIsNOOP() {
assert 0
}
test_HeteroChannelRDPushIsNOOP() {
assert 0
}
doc_HomoChannelRDPushOk="NOT IMPLEMENTED Rhizome direct push between nodes with bundles on shared channels transfers those bundles"
setup_HomoChannelRDPushOk() {
assert 0
}
test_HomoChannelRDPushOk() {
assert 0
}
doc_HeteroChannelRDPullIsNOOP="NOT IMPLEMENTED Rhizome direct pull between nodes with disjoint channel lists transfers nothing"
setup_HeteroChannelRDPullIsNOOP() {
assert 0
}
test_HeteroChannelRDPullIsNOOP() {
assert 0
}
doc_HomoChannelRDPullOk="NOT IMPLEMENTED Rhizome direct pull between nodes with bundles on shared channels transfers those bundles"
setup_HomoChannelRDPullOk() {
assert 0
}
test_HomoChannelRDPullOk() {
assert 0
}
runTests "$@"