OSIsoft is pleased to offer some PI System Deployment Tests in order for you to validate
your systems.
One way to use these to tests is to check and make sure your system is healthy prior
to an upgrade, and then you can rerun the tests after you
complete your upgrades and verify that everything is still working as expected.
After you have completed running your tests, you will see a report with a readout of each
test performed as shown here.
We can click into each test that was performed and see how our system is doing.
Keep in mind, these tests serve as a sample, and you should adapt these tests to correspond
to your company’s architecture and setup.
OSIsoft recommends that you only run these tests on your testing, development or staging
environments, and to not run these tests on any production
environments directly.
Let’s take a look at how we can access the tests and use them on our systems to
ensure an upgrade is successful.
To download these tests, you can go to our OSIsoft GitHub page.
I’ll navigate to the “OSI-Samples-PI-System” Repository and click on the “PI System Deployment
Tests” folder.
Before I download a zipfile with all of the Deployment Test examples, let’s take a look
at the ReadMe file.
There are 3 main directories that we can take a look at:
Source contains the AppConfig file which we will fill out to say which PI System components
we want to run tests on.
The source folder also contains the tests themselves.
Scripts contain the powershell script to launch the tests.
We noted in the requirements that we need to be able to run these scripts as an administrator
on our test machine.
The xml folder contains a mock AF database that OSIsoft provides in order to execute
several tests.
The mock database is that of a Wind Farm and is called OSIsoftTest-Wind.xml
The Wind Farm database is created along with associated PI Points for testing via the powershell
script and everything can be easily removed when
the tests are finished executing via the same powershell script.
We’ll go over that in a minute during the demo of the tests.
Let’s download a zipfile of all the test components that we just described and walkthrough
an example on my test machine.
To download, I’ll go out to the OSI Samples PI System page and click on the green button
that says “Clone or Download” and Download Zip.
Note: when the tests are run on a machine for the first time, some required assemblies
will be downloaded so the machine needs to be connected to internet.
As shown in readme files Now that I’ve unzipped the folder on my
test machine, I’ll open the app.config file from the source folder and will input the
required parameters at the top.
We have 4 required pieces of information such as the target Data Archive, the AF server,
and where the analysis service is installed.
The last piece of information is filled out by default and is the name of the AF database
used for testing.
You can leave it as is, but you can also rename it to another database to be used for testing.
If you would like to test additional PI system components such as the notifications service
or PI Vision,
Then you can input the optional parameters into the App Config file.
Let’s kick off our powershell script, I’ll run the console as an administrator, and will
navigate to my script.
It will ask to confirm that my inputs to the App.Config file are correct, and as those look
good, I’ll press Enter.
If I have run the Deployment Tests before, and there is an existing AF database that
matches my input in the app.config file, then it will ask me if want to use that same
database and keep the created PI Points in place.
This is common after an upgrade where you would use these tests to validate everything
is operating as it should.
Once the test database and associated PI Points are in place, there are some preliminary checks
that have to succeed before moving on to the rest of the tests.
It will check for communication and basic function of PI System components before moving
on to more detailed tests.
If these preliminary checks fail, I may need to recheck my appconfig file or do some troubleshooting
on my system components.
Next, it will move onto the bulk of the tests and I’ll speed it up to go over the last
steps of the script.
If you are running this test prior to an upgrade then I would leave the test database along
with all additional PI points created for testing.
After you complete an upgrade and run the tests again, you’ll want to remove the database
and testing tags.
I’ve finished my testing, so I’ll remove the database and points
Now that the tests have run, I have a few more items added to my directory.
Let’s take a look at the logs, which gives me a printout of the powershell script, so
we can always reference these.
In the test results folder I can see the report of my different tests.
I can see the preliminary checks passed and take a look in detail at the different categories
of tests and the individual tests with their status.
In my case, all of my tests were passed successfully, and I have validated that my system is operational
after an upgrade.
We hope you’ll be able to adapt these tests to meet the needs of your architecture.
To provide feedback on the Deployments tests, please visit the OSIsoft GitHub feedback page
on https://feedback.osisoft.com/ . I’ll link the page in the video description.
As always, If you found this video helpful please like the video and subscribe to our channel for more updates.