Skip to content

Commit 96a1a7c

Browse files
committed
fix: vfs changes related to conf to made at the conf level
- Based on the Enable ACL and Security Label param, update the conf beforehand rather than updating after bring up Signed-off-by: Manimaran-MM <manim@redhat.com>
1 parent 6f6b57c commit 96a1a7c

File tree

3 files changed

+37
-33
lines changed

3 files changed

+37
-33
lines changed

ci_utils/vfs/vfs_setup.py

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ def configure_export(self):
4747
Path = "/{self.vfs_volume}";
4848
Pseudo = "/{self.vfs_volume}";
4949
Access_type = RW;
50-
Disable_ACL = True;
50+
Disable_ACL = {str(not self.enable_acl).capitalize()};
5151
Protocols = "3","4";
5252
Transports = "UDP","TCP";
5353
SecType = "sys";
54-
Security_Label = False;
54+
Security_Label = {str(self.security_label).capitalize()};
5555
FSAL {{
5656
Name = VFS;
5757
}}
@@ -78,41 +78,44 @@ def validate_export(self):
7878
run_cmd(self.session, "grep --with-filename -e '' /etc/ganesha/exports/*.conf", check=False)
7979
raise RuntimeError(f"Export {self.vfs_volume} not found!")
8080

81+
# Commenting out below enablement as the changes are already done in the export configuration
82+
# Retaining the code for future reference for enabling other features
83+
8184
# -------------------------------
8285
# Enable ACL if required
8386
# -------------------------------
84-
def enable_acl_if_required(self):
85-
logger.info("[TEST]: Checking if ACL needs to be enabled")
86-
if self.enable_acl:
87-
logger.info("Enabling ACL for volume...")
88-
run_cmd(self.session, f"sed -i s/'Disable_ACL = .*'/'Disable_ACL = false;'/g {self.export_conf}")
89-
run_cmd(self.session, f"cat {self.export_conf}")
90-
export_id, _ = run_cmd(self.session, f"grep 'Export_Id' {self.export_conf} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\\([0-9]*\\).*/\\1/'")
91-
run_cmd(
92-
self.session,
93-
f"dbus-send --type=method_call --print-reply --system "
94-
f"--dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr "
95-
f"org.ganesha.nfsd.exportmgr.UpdateExport string:{self.export_conf} "
96-
f"string:\"EXPORT(Export_Id = {export_id})\""
97-
)
87+
# def enable_acl_if_required(self):
88+
# logger.info("[TEST]: Checking if ACL needs to be enabled")
89+
# if self.enable_acl:
90+
# # logger.info("Enabling ACL for volume...")
91+
# # run_cmd(self.session, f"sed -i s/'Disable_ACL = .*'/'Disable_ACL = false;'/g {self.export_conf}")
92+
# run_cmd(self.session, f"cat {self.export_conf}")
93+
# export_id, _ = run_cmd(self.session, f"grep 'Export_Id' {self.export_conf} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\\([0-9]*\\).*/\\1/'")
94+
# run_cmd(
95+
# self.session,
96+
# f"dbus-send --type=method_call --print-reply --system "
97+
# f"--dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr "
98+
# f"org.ganesha.nfsd.exportmgr.UpdateExport string:{self.export_conf} "
99+
# f"string:\"EXPORT(Export_Id = {export_id})\""
100+
# )
98101

99102
# -------------------------------
100103
# Enable Security_Label if required
101104
# -------------------------------
102-
def enable_security_label_if_required(self):
103-
logger.info("[TEST]: Checking if Security_Label needs to be enabled")
104-
if self.security_label:
105-
logger.info("Enabling Security_Label for volume...")
106-
run_cmd(self.session, f"sed -i s/'Security_Label = .*'/'Security_Label = True;'/g {self.export_conf}")
107-
run_cmd(self.session, f"cat {self.export_conf}")
108-
export_id, _ = run_cmd(self.session, f"grep 'Export_Id' {self.export_conf} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\\([0-9]*\\).*/\\1/'")
109-
run_cmd(
110-
self.session,
111-
f"dbus-send --type=method_call --print-reply --system "
112-
f"--dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr "
113-
f"org.ganesha.nfsd.exportmgr.UpdateExport string:{self.export_conf} "
114-
f"string:\"EXPORT(Export_Id = {export_id})\""
115-
)
105+
# def enable_security_label_if_required(self):
106+
# logger.info("[TEST]: Checking if Security_Label needs to be enabled")
107+
# if self.security_label:
108+
# logger.info("Enabling Security_Label for volume...")
109+
# run_cmd(self.session, f"sed -i s/'Security_Label = .*'/'Security_Label = True;'/g {self.export_conf}")
110+
# run_cmd(self.session, f"cat {self.export_conf}")
111+
# export_id, _ = run_cmd(self.session, f"grep 'Export_Id' {self.export_conf} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\\([0-9]*\\).*/\\1/'")
112+
# run_cmd(
113+
# self.session,
114+
# f"dbus-send --type=method_call --print-reply --system "
115+
# f"--dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr "
116+
# f"org.ganesha.nfsd.exportmgr.UpdateExport string:{self.export_conf} "
117+
# f"string:\"EXPORT(Export_Id = {export_id})\""
118+
# )
116119

117120
# -------------------------------
118121
# Main export workflow
@@ -123,6 +126,6 @@ def export_volume(self):
123126
self.configure_export()
124127
run_cmd(self.session, "sleep 5")
125128
self.validate_export()
126-
self.enable_acl_if_required()
127-
self.enable_security_label_if_required()
129+
# self.enable_acl_if_required()
130+
# self.enable_security_label_if_required()
128131
logger.info("Export completed successfully.")

ci_utils/virtual_machine/vm_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def setup_network(self):
7979
)
8080
run_cmd(self.session, f"virsh net-define {remote_xml}", check=False)
8181
run_cmd(self.session, "virsh net-start default")
82-
run_cmd(self.session, "virsh net-autostart default"
82+
run_cmd(self.session, "virsh net-autostart default")
8383
self.network = "default"
8484

8585
# -----------------------

tests/test_pynfs_cthon.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ def test_pynfs_acl_vfs(create_session, cmake_flags):
346346
f.write(failure_msg)
347347
with open(SUMMARY_STATUS, "a", encoding="utf-8") as f:
348348
f.write("\nFailed")
349+
logger.error("Error: Sleeping for debugging")
349350

350351
# -----------------------
351352
# Test 4: PyNFS with GPFS

0 commit comments

Comments
 (0)