summaryrefslogtreecommitdiffstats
path: root/tests/bugs/glusterd/bug-1482906-peer-file-blank-line.t
blob: 967595e4dbb0482f43250fda7d066dc7fb1b40e0 (plain)
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
#!/bin/bash

. $(dirname $0)/../../include.rc
. $(dirname $0)/../../cluster.rc

#Tests for add new line in peers file
function add_new_line_to_peer_file  {
	UUID_NAME=$($CLI_1 peer status  | grep Uuid)
	PEER_ID=$(echo $UUID_NAME | cut -c 7-)
	GD_WD=$($CLI_1 system getwd)
	GD_WD+=/peers/
	PATH_TO_PEER_FILE=$GD_WD$PEER_ID
	sed -i '1s/^/\n/gm; $s/$/\n/gm' $PATH_TO_PEER_FILE
}

cleanup;

TEST launch_cluster 2;

TEST $CLI_1 peer probe $H2;

EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count

add_new_line_to_peer_file

TEST kill_glusterd 1
TEST  $glusterd_1

cleanup;