xcat2 / xcat-inventory

An inventory tool for xcat cluster
8 stars 16 forks source link

[FVT]: xcat-inventory could not import the INCLUDE files #158

Closed tingtli closed 5 years ago

tingtli commented 5 years ago

Here is the steps.

  1. create files
    
    [root@c910f03c01p13 ~]# cp -rf /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/imagedata/test_osimage /tmp/imagedata

[root@c910f03c01p13 imagedata]# cp -rf /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/imagedata/test_osimage /tmp/imagedata [root@c910f03c01p13 imagedata]# ls export test_osimage


2. create image

[root@c910f03c01p13 imagedata]# cat /tmp/imagedata/test_osimage/test_osimage.stanza |mkdef -z 1 object definitions have been created or modified. [root@c910f03c01p13 imagedata]# rm -rf /tmp/imagedata/test_osimage/test_osimage.stanza [root@c910f03c01p13 imagedata]# lsdef -t osimage -o test_osimage Object name: test_osimage exlist=/tmp/imagedata/test_osimage/exlist imagetype=linux otherpkglist=/tmp/imagedata/test_osimage/otherpkglist partitionfile=/tmp/imagedata/test_osimage/partitionfile pkglist=/tmp/imagedata/test_osimage/pkglist postinstall=/tmp/imagedata/test_osimage/postinstall provmethod=install synclists=/tmp/imagedata/test_osimage/synclists template=/tmp/imagedata/test_osimage/template.tmpl


3.export image

[root@c910f03c01p13 imagedata]# xcat-inventory export -t osimage -o test_osimage -d /tmp/imagedata/export The osimage objects has been exported to directory /tmp/imagedata/export [root@c910f03c01p13 imagedata]# ls -lFR /tmp/imagedata/export /tmp/imagedata/export: total 0 drwxr-xr-x 4 root root 51 Nov 13 21:41 test_osimage/

/tmp/imagedata/export/test_osimage: total 4 -rw-r--r-- 1 root root 678 Nov 13 21:41 definition.yaml drwxr-xr-x 2 root root 19 Nov 13 21:41 etc/ drwxr-xr-x 3 root root 23 Nov 13 21:41 tmp/

/tmp/imagedata/export/test_osimage/etc: total 64 -rw-r--r-- 1 root root 65206 Nov 13 21:41 hosts

/tmp/imagedata/export/test_osimage/tmp: total 0 drwxr-xr-x 3 root root 26 Nov 13 21:41 imagedata/

/tmp/imagedata/export/test_osimage/tmp/imagedata: total 0 drwxr-xr-x 2 root root 309 Nov 13 21:41 test_osimage/

/tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage: total 76 -rw-r--r-- 1 root root 69 Nov 13 21:41 exlist -rw-r--r-- 1 root root 33 Nov 13 21:41 file1.1 -rw-r--r-- 1 root root 46 Nov 13 21:41 file2.1 -rw-r--r-- 1 root root 46 Nov 13 21:41 file2.2 -rw-r--r-- 1 root root 46 Nov 13 21:41 file2.3 -rw-r--r-- 1 root root 92 Nov 13 21:41 file3.1 -rw-r--r-- 1 root root 92 Nov 13 21:41 file3.2 -rw-r--r-- 1 root root 50 Nov 13 21:41 file3.3 -rw-r--r-- 1 root root 82 Nov 13 21:41 file4.1 -rw-r--r-- 1 root root 82 Nov 13 21:41 file4.2 -rw-r--r-- 1 root root 82 Nov 13 21:41 file4.3 -rw-r--r-- 1 root root 57 Nov 13 21:41 file5 -rw-r--r-- 1 root root 40 Nov 13 21:41 file6 -rw-r--r-- 1 root root 169 Nov 13 21:41 otherpkglist -rw-r--r-- 1 root root 75 Nov 13 21:41 partitionfile -rw-r--r-- 1 root root 75 Nov 13 21:41 pkglist -rw-r--r-- 1 root root 73 Nov 13 21:41 postinstall -rw-r--r-- 1 root root 44 Nov 13 21:41 synclists -rw-r--r-- 1 root root 134 Nov 13 21:41 template.tmpl


4.rmimage

[root@c910f03c01p13 imagedata]# rmdef -t osimage -o test_osimage 1 object definitions have been removed. [root@c910f03c01p13 imagedata]# rm -rf /tmp/imagedata/test_osimage


5.import image, diff return error

[root@c910f03c01p13 imagedata]# xcat-inventory import -t osimage -d /tmp/imagedata/export loading inventory date in "/tmp/imagedata/export/test_osimage/definition.yaml" start to import "osimage" type objects preprocessing "osimage" type objects writting "osimage" type objects Inventory import successfully! The object test_osimage has been imported [root@c910f03c01p13 imagedata]# lsdef -t osimage -o test_osimage Object name: test_osimage environvar=OBJNAME=test_osimage exlist=/tmp/imagedata/test_osimage/exlist imagetype=linux otherpkglist=/tmp/imagedata/test_osimage/otherpkglist partitionfile=/tmp/imagedata/test_osimage/partitionfile pkglist=/tmp/imagedata/test_osimage/pkglist postinstall=/tmp/imagedata/test_osimage/postinstall provmethod=install synclists=/tmp/imagedata/test_osimage/synclists template=/tmp/imagedata/test_osimage/template.tmpl [root@c910f03c01p13 imagedata]# diff -r /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/ /tmp/imagedata/test_osimage Only in /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/: file1.1 Only in /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/: file2.1 Only in /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/: file2.2 Only in /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/: file2.3 Only in /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/: file3.1 Only in /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/: file3.2 Only in /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/: file3.3 Only in /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/: file4.1 Only in /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/: file4.2 Only in /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/: file4.3 Only in /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/: file5 Only in /tmp/imagedata/export/test_osimage/tmp/imagedata/test_osimage/: file6 [root@c910f03c01p13 imagedata]# echo $? 1

immarvin commented 5 years ago

fixed in https://github.com/xcat2/xcat-inventory/pull/115

immarvin commented 5 years ago

verified by autotest case export_import_osimage_with_INCLUDE_in_file:


------END::export_import_osimage_with_INCLUDE_in_file::Passed::Time:Sat Dec 29 05:02:44 2018 ::Duration::5 sec------
------Total: 1 , Failed: 0------

xCAT automated test finished at Sat Dec 29 05:02:44 2018
Please check results in the /opt/xcat/bin/../share/xcat/tools/autotest/result/,
and see /opt/xcat/bin/../share/xcat/tools/autotest/result//failedcases.20181229050238 file for failed cases.
see /opt/xcat/bin/../share/xcat/tools/autotest/result//performance.report.20181229050238 file for time consumption
[root@c910f03c05k21 xcat-core]#
zet809 commented 5 years ago

Verified as above, so close this issue.