Thank you to everyone that contributed great ideas and use cases in response to my previous blog. As promised, here are the links to the slide deck that I assembled from your great feedback. For those that don't know what I am talking about, this is a slide deck that gives practical use cases and examples of how zones can be used in the real world. Click here for the Open Document Presentation version and here for the Portable Document Format version.
I hope you have a very blessed day!
Brad
Friday, February 29, 2008
Wednesday, February 20, 2008
QA Testing With The Zone Manager
One of the great things that I love to do at Sun is work on Directory Services. I have worked on directory server as an architect and consultant in Sun Professional Services, as an engineer in Directory Deployment Engineering, and now as an architect in the Communications Market Area of Software Sales.
In each of these roles, one of the aspects of keeping up with the product is evaluating it for myself. In engineering I also did quite a bit of Quality Assurance (QA) testing as well. David in his comment asked if The Zone Manager could be used for QA testing. I responded that The Zone Manager is an ideal tool for that very purpose.
For this post, I thought it would be cool to give you a basic QA setup script that I have used to test the zip install, CLI setup and web admin setup of DSEE 6.2. With the following invocation of The Zone Manager, I add a sparse zone named dsee, disable all un-necessary services, setup TCP/IP and name services, read-only mount /data, remotely install tomcat5 from Blastwave, and finally runs my ds setup script.
The dsSetup.sh script installs DSEE6 from the zip file located in /data/images, sets up a directory server instance named ds1, and sets up the Directory Service Console (DSCC).
Once dsSetup.sh finishes running, you can login to the DSCC via the URL: http://192.168.0.10:8080/dscc
Here is a screen shot of the DSCC login page.

Here is a screen shot of what it looks like once you have logged in.

There are lots of great things to see in the new directory console. However, one of my absolute favorites is the ability to see the replication topology. Kudos once again to engineering for that tremendous feature.

The value of zones and The Zone Manager relative to software quality assurance is that you can in a repeatable and automated way create a fresh new image of Solaris configured to your specifications, install your product and test it any way you like. Tear down the zone and repeat the process for every build of your software product. Some may think this is overkill. However if your software installs packages, changes system configuration files, or in any way doesn't cleanly clean up after itself during un-installation you have no way of guaranteeing that each QA run starts from the same starting point.
David, I hope that you find this QA example useful.
Regards,
Brad
In each of these roles, one of the aspects of keeping up with the product is evaluating it for myself. In engineering I also did quite a bit of Quality Assurance (QA) testing as well. David in his comment asked if The Zone Manager could be used for QA testing. I responded that The Zone Manager is an ideal tool for that very purpose.
For this post, I thought it would be cool to give you a basic QA setup script that I have used to test the zip install, CLI setup and web admin setup of DSEE 6.2. With the following invocation of The Zone Manager, I add a sparse zone named dsee, disable all un-necessary services, setup TCP/IP and name services, read-only mount /data, remotely install tomcat5 from Blastwave, and finally runs my ds setup script.
# zonemgr -a add -n dsee6 -z /zones -P sundsee6 -s lock \Note that the ds1 parameter passed to the script is the instance name given to the ds instance setup by the script. Also sundsee6 is the password given for the DSCC console and the rootdn user (cn=Directory Manager)of the directory server instance.
-G tomcat5 -I "192.168.0.10|bfe0|24|dsee6" -r /data \
-C /etc/resolv.conf -C /etc/nsswitch.conf \
-X "/data/scripts/dsSetup.sh ds1 sundsee6"
The dsSetup.sh script installs DSEE6 from the zip file located in /data/images, sets up a directory server instance named ds1, and sets up the Directory Service Console (DSCC).
Once dsSetup.sh finishes running, you can login to the DSCC via the URL: http://192.168.0.10:8080/dscc
Here is a screen shot of the DSCC login page.
Here is a screen shot of what it looks like once you have logged in.
There are lots of great things to see in the new directory console. However, one of my absolute favorites is the ability to see the replication topology. Kudos once again to engineering for that tremendous feature.
The value of zones and The Zone Manager relative to software quality assurance is that you can in a repeatable and automated way create a fresh new image of Solaris configured to your specifications, install your product and test it any way you like. Tear down the zone and repeat the process for every build of your software product. Some may think this is overkill. However if your software installs packages, changes system configuration files, or in any way doesn't cleanly clean up after itself during un-installation you have no way of guaranteeing that each QA run starts from the same starting point.
David, I hope that you find this QA example useful.
Regards,
Brad
Tuesday, February 12, 2008
A Great Bash Scripting Nugget...
Hello Again,
In the past few days while working on a automated provisioning script for Sun's implementation of Xen for Solaris called xVM. During that journey Bernd Eggink rescued me by introducing me to the "here strings" feature of bash. So for everyone's benefit, I would like to share my pilgrimage with you for your benefit.
Here is a sample bash script that populates an array (FileList) with a variable (File) that is populated from the output of ls -1. This is the way that I have traditionally populated an array from the output of a command.
Have a great scripting day!!!
Thanks again Bernd! And thanks Mendel for your great guide!
Brad
In the past few days while working on a automated provisioning script for Sun's implementation of Xen for Solaris called xVM. During that journey Bernd Eggink rescued me by introducing me to the "here strings" feature of bash. So for everyone's benefit, I would like to share my pilgrimage with you for your benefit.
Here is a sample bash script that populates an array (FileList) with a variable (File) that is populated from the output of ls -1. This is the way that I have traditionally populated an array from the output of a command.
This used to work on earlier versions of bash and still works for Solaris ksh. However, it does not work on bash version 3.2.25(1). Bernd explains why this no longer works in bash below:
declare -a FileList=('')
declare -i d=0
ls -1| while read File
do
FileList[${d}]=${File}
d=$((10#${d}+1))
done
This is normal bash behaviour, see FAQ E4. As bash executes _all_ parts of a pipe in subshells (in contrast to ksh, where the last component is executed in the current shell), the variable 'FileList' being assigned here is local to the subshell. After the loop the variable 'FileList' declared in line 1 (which happens to have the same name, but that doesn't matter) is unchanged.Here is the example that Bernd suggested as an alternative which worked great.
I went back to my favorite bash reference, The Advanced Bash Scripting Guide by Mendel Cooper to see if this sort of example was already in there and I just overlooked it. To my surprise I found the following even more succinct example in section 18.1 (Here Strings).
while read File
do
FileList[d]=$File
(( d=d+1 ))
done <<<"$(ls -1)"
So if you want a really succinct and simple method of populating an array vi command line put, I suggest this last example.read -r -a FileList <<< $(ls -1)
Have a great scripting day!!!
Thanks again Bernd! And thanks Mendel for your great guide!
Brad
Subscribe to:
Posts (Atom)