Skip to content

Commit d061c84

Browse files
dineshchitlangiaelek
authored andcommitted
HDDS-2140. Add robot test for GDPR feature
Closes #1542
1 parent bffcd33 commit d061c84

File tree

1 file changed

+89
-0
lines changed
  • hadoop-ozone/dist/src/main/smoketest/gdpr

1 file changed

+89
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
*** Settings ***
17+
Documentation Smoketest Ozone GDPR Feature
18+
Library OperatingSystem
19+
Library BuiltIn
20+
Library String
21+
Resource ../commonlib.robot
22+
Suite Setup Generate volume
23+
24+
*** Variables ***
25+
${volume} generated
26+
27+
*** Keywords ***
28+
Generate volume
29+
${random} = Generate Random String 5 [LOWER]
30+
Set Suite Variable ${volume} ${random}
31+
32+
*** Test Cases ***
33+
Test GDPR disabled
34+
Test GDPR(disabled) without explicit options ${volume}
35+
36+
Test GDPR --enforcegdpr=true
37+
Test GDPR with --enforcegdpr=true ${volume}
38+
39+
Test GDPR -g=true
40+
Test GDPR with -g=true ${volume}
41+
42+
Test GDPR -g=false
43+
Test GDPR with -g=false ${volume}
44+
45+
*** Keywords ***
46+
Test GDPR(disabled) without explicit options
47+
[arguments] ${volume}
48+
Execute ozone sh volume create /${volume} --quota 100TB
49+
Execute ozone sh bucket create /${volume}/mybucket1
50+
${result} = Execute ozone sh bucket info /${volume}/mybucket1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.name=="mybucket1") | .metadata | .gdprEnabled'
51+
Should Be Equal ${result} null
52+
Execute ozone sh key put /${volume}/mybucket1/mykey /opt/hadoop/NOTICE.txt
53+
Execute rm -f NOTICE.txt.1
54+
${result} = Execute ozone sh key info /${volume}/mybucket1/mykey | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.name=="mykey") | .metadata | .gdprEnabled'
55+
Should Be Equal ${result} null
56+
Execute ozone sh key delete /${volume}/mybucket1/mykey
57+
58+
Test GDPR with --enforcegdpr=true
59+
[arguments] ${volume}
60+
Execute ozone sh bucket create --enforcegdpr=true /${volume}/mybucket2
61+
${result} = Execute ozone sh bucket info /${volume}/mybucket2 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.name=="mybucket2") | .metadata | .gdprEnabled'
62+
Should Be Equal ${result} true
63+
Execute ozone sh key put /${volume}/mybucket2/mykey /opt/hadoop/NOTICE.txt
64+
Execute rm -f NOTICE.txt.1
65+
${result} = Execute ozone sh key info /${volume}/mybucket2/mykey | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.name=="mykey") | .metadata | .gdprEnabled'
66+
Should Be Equal ${result} true
67+
Execute ozone sh key delete /${volume}/mybucket2/mykey
68+
69+
Test GDPR with -g=true
70+
[arguments] ${volume}
71+
Execute ozone sh bucket create -g=true /${volume}/mybucket3
72+
${result} = Execute ozone sh bucket info /${volume}/mybucket3 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.name=="mybucket3") | .metadata | .gdprEnabled'
73+
Should Be Equal ${result} true
74+
Execute ozone sh key put /${volume}/mybucket3/mykey /opt/hadoop/NOTICE.txt
75+
Execute rm -f NOTICE.txt.1
76+
${result} = Execute ozone sh key info /${volume}/mybucket3/mykey | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.name=="mykey") | .metadata | .gdprEnabled'
77+
Should Be Equal ${result} true
78+
Execute ozone sh key delete /${volume}/mybucket3/mykey
79+
80+
Test GDPR with -g=false
81+
[arguments] ${volume}
82+
Execute ozone sh bucket create /${volume}/mybucket4
83+
${result} = Execute ozone sh bucket info /${volume}/mybucket4 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.name=="mybucket4") | .metadata | .gdprEnabled'
84+
Should Be Equal ${result} null
85+
Execute ozone sh key put /${volume}/mybucket4/mykey /opt/hadoop/NOTICE.txt
86+
Execute rm -f NOTICE.txt.1
87+
${result} = Execute ozone sh key info /${volume}/mybucket4/mykey | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.name=="mykey") | .metadata | .gdprEnabled'
88+
Should Be Equal ${result} null
89+
Execute ozone sh key delete /${volume}/mybucket4/mykey

0 commit comments

Comments
 (0)