One more thing. It seems that the forked process inherits the environment entries of the forking process. So if the root container has the Jenkins build related environment entries, then it will be added to the forked instances as well. Still in the test I cannot kill the instance one by one. I planned to reuse the ProcessTree ( https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/util/ProcessTree.java) of jenkins to simulate failing nodes. But if I cannot define different env entries for different instances it is not feasible.
2015-06-12 10:39 GMT+02:00 Jean-Baptiste Onofré <[email protected]>: > Hi, > > I meant, that in Pax-Exam, you do: > > @Configuration > public Option[] config() { > Option[] options = new Option[]{ > ... > > editConfigurationFileExtend("instances/foo/etc/system.properties", > "foo.bar", System.getEnv("foo.bar")), > }; > ... > return options; > } > > Regards > JB > > On 06/12/2015 10:33 AM, Gábor Lipták wrote: > >> Hi Jean-Baptiste, >> >> Thanks for the prompt answer. I checked what you said. I created an >> instance and started it. The system.properties contains such stuff for >> example: >> karaf.name <http://karaf.name> = node3 >> karaf.default.repository = system >> >> However when I list the env entries with the following command: >> >cat /proc/PID/environ >> >> None of the properties set inside system.properties are displayed. I >> need environment entries, not system properties. >> >> Thanks and kind regards, >> >> Gábor >> >> >> 2015-06-12 10:20 GMT+02:00 Jean-Baptiste Onofré <[email protected] >> <mailto:[email protected]>>: >> >> Hi Gabor, >> >> you can update the etc/system.properties of the child instance where >> you define the environment entry. >> >> Regards >> JB >> >> On 06/12/2015 10:17 AM, Gábor Lipták wrote: >> >> Hi, >> >> I have a problem (see http://stackoverflow.com/q/30791369/337621 >> ): >> >> I am testing a clustering solution for Felix with Pax Exam and >> Karaf >> (see >> >> http://planet.jboss.org/post/advanced_integration_testing_with_pax_exam_karaf >> ). >> I start up several Karaf instances and play with them in the test. >> >> If I want to be sure that the Karaf instances will be stopped in >> Jenkins >> when my test is aborted for some reason then I need to set some >> environment entries for the forked containers (see How to fork a >> background process in Jenkins? Setting BUILD_ID and using nohup >> seems to >> be non working) Is there a way to do so? I can set system >> properties >> with the admin:create command option called --java-opts but I >> cannot set >> any environment entry for the forked process. Do you know any way >> or >> trick to set them? >> >> Any help appreciated. Do you think this is a good improvement >> for the >> admin service? Should I create a JIRA for it? >> >> Regards, >> >> Gábor Lipták >> >> >> -- >> Jean-Baptiste Onofré >> [email protected] <mailto:[email protected]> >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> >> >> > -- > Jean-Baptiste Onofré > [email protected] > http://blog.nanthrax.net > Talend - http://www.talend.com >
