My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 49: Validation of xml policy files
1 person starred this issue and may be notified of changes. Back to list
Status:  Verified
Owner:  sneha.hendre@gmail.com
Closed:  Feb 2009


 
Reported by postri...@gmail.com, Jan 30, 2009
The xml files entered by the user while enabling the OHSM should be verified.

Rishi and Sneha are working on it.
Jan 30, 2009
#1 postri...@gmail.com
The validation of allocatin policy files has been done.

Moving to validate the relocation policy file


Jan 30, 2009
Project Member #2 sandeepksinha
Quick !!!
Really quick.
Keep rocking,

Updates the Logs.
Jan 30, 2009
#3 postri...@gmail.com
The log generated for the attached sample allocation file :


ohsm : error 101 uid not present on system
ohsm : error tier does not exists
ohsm : error 509 uid not present on system
ohsm : error 503 uid not present on system
ohsm : error 5090 uid not present on system
ohsm : error 509 uid not present on system
ohsm : error 504 uid not present on system
ohsm : error number of users in <info> is less than the entered users

ohsm ; error gid 501 appears 2 times in allocation file
ohsm : error tier does not exists
ohsm : error tier does not exists
ohsm : error in parsing the allocation policy file alloc.xml

ohsm : cannot be enabled
alloc.xml
1.2 KB   View   Download
Jan 30, 2009
#4 postri...@gmail.com

ohsm : error 101 uid not present on system
ohsm : error tier does not exists
ohsm : error 503 uid not present on system
ohsm : error 503 uid not present on system
ohsm : error 504 uid not present on system
ohsm ; error uid 502 appears 2 times in allocation file
ohsm : error number of users in <info> greater than users spcified
ohsm ; error 5021 gid not present on system
ohsm : error tier does not exists
ohsm : error number of groups in <info> is less than the entered groups

ohsm : error tier does not exists
ohsm : error in parsing the allocation policy file alloc.xml

ohsm : cannot be enabled
alloc.xml
1.2 KB   View   Download
Jan 30, 2009
#5 postri...@gmail.com
we are trying to print the line numbers also where the error was found.

I think that will make it look better.

Any more suggestions
Status: Review-Req
Jan 30, 2009
#6 postri...@gmail.com
The parsing of tier info xml file has been changed heavily.

This will take some time to finish
Status: In-progress
Jan 30, 2009
#7 postri...@gmail.com
I am rectifying sam table problem in  issue 48 .
This issue is on hold for now.
Jan 30, 2009
#8 postri...@gmail.com
I am using temporary file for getting the tier device info.


Jan 30, 2009
Project Member #9 sneha.hendre@gmail.com
Relocation xml file validation done.
Jan 30, 2009
Project Member #10 sneha.hendre@gmail.com
Got the line numbers.
printing it successfully ...
Jan 30, 2009
Project Member #11 sneha.hendre@gmail.com
Errors will now be showing line nos. also :)
Jan 30, 2009
Project Member #12 sandeepksinha
It would be better if you can provide some logs.
Jan 30, 2009
#13 postri...@gmail.com
The temporary file issue has been resolved by SKS.

We are using stat() on file name
Jan 30, 2009
#14 postri...@gmail.com
The validation is almost complete.

small changes remains like removing the use of temp file and adding line numbers to
more types of errors

will be completed soon

Good Work Sneha !!
Jan 30, 2009
Project Member #15 sneha.hendre@gmail.com

ohsm [5] : wrong value in <INFO> tag
ohsm [5] : fatal : cannot proceed further

Error in parsing the relocation file


Jan 30, 2009
Project Member #16 sneha.hendre@gmail.com
ohsm [12] : wrong value in <FAA> tag
ohsm [19] : wrong value in <FSIZE> tag
ohsm [19] : wrong value in <REL> tag
Error in parsing relocate.xml


Jan 30, 2009
Project Member #17 sneha.hendre@gmail.com

ohsm [11] : error 501 uid not present on system
ohsm [14] : wrong value in <group> tag
ohsm [14]: fatal : cannot proceed further

ohsm : error in parsing the allocation policy file alloc.xml

ohsm : cannot be enabled
Jan 30, 2009
Project Member #18 sneha.hendre@gmail.com
If for the wrong entrance of the value in xml file further malloc fails
Then program is aborted there itself before the system.

Else the program keeps on listing the errors and aborts in the end doesn't pass the
structure.
Rather passes NULL
Jan 30, 2009
Project Member #19 sneha.hendre@gmail.com
Error is not displayed if a proper invalid start and end tag is entered.

eg.
<abc> 500 </abc>

instead of 
<user> 500 </user>


Jan 31, 2009
#20 postri...@gmail.com
The use of temp file has not been eliminated
Jan 31, 2009
Project Member #21 sneha.hendre@gmail.com
Got the way to validate the xml file for tags through DTD in libxml2

Just have write a dtd for the file and run the command

xmllint --valid --noout file.xml

:)
Jan 31, 2009
Project Member #22 sneha.hendre@gmail.com
Now writing the DTD for the files

Jan 31, 2009
Project Member #23 sneha.hendre@gmail.com
finished validating alloc file with dtd
working perfectly fine
without any errors

Jan 31, 2009
Project Member #24 sneha.hendre@gmail.com
major change have occured in the alloc.xml file

since the <users>
was defined twice for information as well as
in the user tier information i.e. 

previously it was

<info>
		<users>1</users>
		<groups>1</groups>
		<types>10</types>
	</info>


	<users>
	    <user>501</user>   <tier>2</tier>    	    	    	    	    
	</users>

......and so on

now it will be like:

<info>
		<USER> 2 </USER>
		<GROUP>1</GROUP>
		<TYPE>10</TYPE>
	</info>
	<users>
	    <user>500</user>   <tier>2</tier>     
	</users>

...and so on


Jan 31, 2009
Project Member #25 sneha.hendre@gmail.com
I think same thing may happen in relocation code too
Now starting the dtd for relocation file

Jan 31, 2009
Project Member #26 sneha.hendre@gmail.com
Validation for relocation xml file completed successfully
No changes were made to the relocate.xml file for this
Jan 31, 2009
Project Member #27 sneha.hendre@gmail.com
DTD validation finished for the device file also
Here are all the files
Just type the command 
in the same directory.


xmllint --valid --noout file.xml

xml files dtd.tar.bz2
1.0 KB   Download
Feb 1, 2009
#28 postri...@gmail.com
The merging of the codes were remaining.

It has now been finished. 

The parser and validation is over now.

Testing remains ... will get on to it shortly.
Feb 3, 2009
#29 postri...@gmail.com
The coding is finished and is working fine
Status: Verified

Powered by Google Project Hosting