Bug 919056

Summary: make sure the version.properties files are updated in server when appropriate
Product: [Other] RHQ Project Reporter: John Mazzitelli <mazz>
Component: Build SystemAssignee: John Mazzitelli <mazz>
Status: ON_QA --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.6CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Mazzitelli 2013-03-07 14:02:46 UTC
when building in a developer's environment, we should make sure the rhq-server-agent-versions.properties file is deleted from the AS7 data/ directory when a new agent binary is detected. This may also be helpful in a production environment for people who preconfigure their agent and want to update that agent binary.

Note that there is another .properties file in /data that needs to have the same thing done to it - the rhq-client.version. That should probably have the same fix.

As good fix would be to check if the file exists - if it does, check the timestamp of the agent (or cli) binary - if the binary is newer than the .properties, that must mean the propeties was generated from an older binary and needs to be refreshed.

Comment 1 John Mazzitelli 2013-03-07 17:36:07 UTC
git commit to master: bbfa2de

to test:

1) start the server and go to Administration>Downloads to see the version info of the agent binary update jar and the CLI binary.

2) under the directory "<rhq-server-install>/jbossas/standalone/data/rhq-downloads" look for these files, they should exist:
* rhq-agent/rhq-server-agent-versions.properties
* rhq-client/rhq-client-version.properties

3) take note of their file timestamps (via "ls -l" for example)

4) press F5 in the browser to refresh Adminstration>Downloads web page, those file timestamps should not change - those files should not be rewritten. You should wait over 60 seconds since the ls -l command shows times with minute precision.

5) now change the file timestamps of the actual binary files (NOT the files you were looking at above in step 2). The actual binary files are located under the directory "<rhq-server-install>/modules/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/rhq.ear/rhq-downloads" - specifically, these two files:
* rhq-agent/rhq-enterprise-agent-<VERSION>.jar
* rhq-client/rhq-remoting-cli-<VERSION>.zip

To change the timestamps, just use the UNIX command "touch":
> cd <rhq-server-install>/modules/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/rhq.ear/rhq-downloads
> touch rhq-agent/rhq-enterprise-agent-*.jar
> touch rhq-client/rhq-remoting-cli-*.zip

6) now refresh the Administration>Downloads page one more time (F5)

7) look at the timestamps of the properties files again (that is, look at the "ls -l" output for the files specified in step 2 above). They should have had their timestamps changed to indicate that they have been written again.