@@ -21,6 +21,16 @@ mkdir -p gh-enterprise-es/node/0
2121touch gh-enterprise-es/node/0/stuff1
2222touch gh-enterprise-es/node/0/stuff2
2323
24+ # Create some fake elasticsearch data in the remote snapshot data directory
25+ if [ " $GHE_VERSION_MAJOR " -ge 2 ]; then
26+ mkdir -p " $GHE_REMOTE_DATA_USER_DIR /elasticsearch-snapshots"
27+ cd " $GHE_REMOTE_DATA_USER_DIR /elasticsearch-snapshots"
28+ echo " fake snapshot file" > " snapshot-1"
29+ echo " fake metadata file" > " metadata-1"
30+ mkdir -p indices/repositories
31+ echo " fake document data" > indices/repositories/dumb-file
32+ fi
33+
2434# Create some test repositories in the remote repositories dir
2535mkdir " $GHE_REMOTE_DATA_USER_DIR /repositories"
2636cd " $GHE_REMOTE_DATA_USER_DIR /repositories"
@@ -84,10 +94,13 @@ begin_test "ghe-backup first snapshot"
8494 # verify all pages data was transferred
8595 diff -ru " $GHE_REMOTE_DATA_USER_DIR /pages" " $GHE_DATA_DIR /current/pages"
8696
87- # TODO ES backup not yet supported under 2.x VM
97+ # ES backup path is different under v11.10.x and v2.x appliances
8898 if [ " $GHE_VERSION_MAJOR " -eq 1 ]; then
89- # verify all ES data was transferred
99+ # verify all ES data was transferred from live directory
90100 diff -ru " $GHE_REMOTE_DATA_USER_DIR /elasticsearch" " $GHE_DATA_DIR /current/elasticsearch"
101+ elif [ " $GHE_VERSION_MAJOR " -ge 2 ]; then
102+ # verify all ES data was transferred from snapshot directory
103+ diff -ru " $GHE_REMOTE_DATA_USER_DIR /elasticsearch-snapshots" " $GHE_DATA_DIR /current/elasticsearch"
91104 fi
92105)
93106end_test
@@ -146,10 +159,13 @@ begin_test "ghe-backup subsequent snapshot"
146159 # verify all pages data was transferred
147160 diff -ru " $GHE_REMOTE_DATA_USER_DIR /pages" " $GHE_DATA_DIR /current/pages"
148161
149- # TODO ES backup not yet supported under 2.x VM
162+ # ES backup path is different under v11.10.x and v2.x appliances
150163 if [ " $GHE_VERSION_MAJOR " -eq 1 ]; then
151- # verify all ES data was transferred
164+ # verify all ES data was transferred from live directory
152165 diff -ru " $GHE_REMOTE_DATA_USER_DIR /elasticsearch" " $GHE_DATA_DIR /current/elasticsearch"
166+ elif [ " $GHE_VERSION_MAJOR " -ge 2 ]; then
167+ # verify all ES data was transferred from snapshot directory
168+ diff -ru " $GHE_REMOTE_DATA_USER_DIR /elasticsearch-snapshots" " $GHE_DATA_DIR /current/elasticsearch"
153169 fi
154170)
155171end_test
0 commit comments