@@ -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." )
0 commit comments