forked from p3ck/restraint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
restraint.spec
547 lines (499 loc) · 21.2 KB
/
restraint.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
# Got Systemd?
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
%global with_systemd 1
%global with_selinux_policy 1
%else
%global with_systemd 0
%global with_selinux_policy 0
%endif
Name: restraint
Version: 0.1.17
Release: 2%{?dist}
Summary: Simple test harness which can be used with beaker
Group: Applications/Internet
License: GPLv3+ and MIT
URL: https://github.com/p3ck/%{name}
Source0: https://github.com/p3ck/%{name}/%{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: pkgconfig
BuildRequires: gettext
BuildRequires: perl-XML-Parser
BuildRequires: openssl-devel
BuildRequires: libselinux-devel
BuildRequires: glibc-devel
%if 0%{?rhel}%{?fedora} > 4
BuildRequires: selinux-policy-devel
%endif
%if %{with_systemd}
BuildRequires: systemd-units
Requires(post): systemd
Requires(pre): systemd
Requires(postun): systemd
%else
Requires(post): chkconfig
Requires(preun): chkconfig
# This is for /sbin/service
Requires(preun): initscripts
Requires(postun): initscripts
%endif
%if %{with_selinux_policy}
BuildRequires: selinux-policy-devel
Requires: selinux-policy >= %{_selinux_policy_version}
%endif
#if not static build
BuildRequires: zlib-devel
# If static build...
%if 0%{?rhel}%{?fedora} >= 6
BuildRequires: libselinux-static
BuildRequires: openssl-static
BuildRequires: glibc-static
%endif
%description
restraint harness which can run standalone or with beaker. when provided a recipe xml it will execute
each task listed in the recipe until done.
%package rhts
Summary: Allow unmodified rhts tests to run under restraint
Group: Applications/Internet
Requires: restraint = %{version}
Provides: rhts-test-env
Obsoletes: rhts-test-env
%description rhts
Legacy package to allow older rhts tests to run under restraint
%package client
Summary: used to run jobs outside of beaker
Group: Applications/Internet
Requires: libxslt
%description client
With the restraint client you can run jobs outside of beaker. This will provide the same
restAPI allowing all results and logs to be recorded from the test machine.
%prep
%setup -q
%build
%ifarch i386
export CFLAGS="-march=i486"
%endif
%if 0%{?rhel} == 4
%ifarch ppc64
export CFLAGS="-mminimal-toc"
%endif
%endif
pushd third-party
make
popd
pushd src
PKG_CONFIG_PATH=../third-party/tree/lib/pkgconfig make STATIC=1
popd
%if %{with_selinux_policy}
make -C selinux -f %{_datadir}/selinux/devel/Makefile
%endif
%install
%{__rm} -rf %{buildroot}
pushd third-party
make clean
popd
make DESTDIR=%{buildroot} install
%if %{with_selinux_policy}
install -p -m 644 -D selinux/restraint.pp $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}/restraint.pp
%endif
# Legacy support.
ln -s rhts-environment.sh $RPM_BUILD_ROOT/usr/bin/rhts_environment.sh
ln -s rstrnt-report-log $RPM_BUILD_ROOT/usr/bin/rhts-submit-log
ln -s rstrnt-report-log $RPM_BUILD_ROOT/usr/bin/rhts_submit_log
ln -s rstrnt-report-result $RPM_BUILD_ROOT/usr/bin/rhts-report-result
ln -s rstrnt-backup $RPM_BUILD_ROOT/usr/bin/rhts-backup
ln -s rstrnt-restore $RPM_BUILD_ROOT/usr/bin/rhts-restore
ln -s rstrnt-reboot $RPM_BUILD_ROOT/usr/bin/rhts-reboot
ln -s rhts-sync-set $RPM_BUILD_ROOT/usr/bin/rhts-recipe-sync-set
ln -s rhts-sync-block $RPM_BUILD_ROOT/usr/bin/rhts-recipe-sync-block
mkdir -p $RPM_BUILD_ROOT/mnt/scratchspace
mkdir -p $RPM_BUILD_ROOT/mnt/testarea
%if 0%{?rhel}%{?fedora} > 4
# Build RHTS Selinux Testing Policy
pushd legacy/selinux
# If dist specific selinux module is present use that.
# Why:
# newer releases may introduce new selinux macros which are not present in
# older releases. This means that a module built under the newer release
# will no longer load on an older release.
# How:
# Simply issue the else statement on the older release and commit the
# policy to git with the appropriate dist tag.
if [ -e "rhts%{?dist}.pp" ]; then
install -p -m 644 -D rhts%{?dist}.pp $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}/rhts.pp
else
make -f %{_datadir}/selinux/devel/Makefile
install -p -m 644 -D rhts.pp $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}/rhts.pp
fi
popd
%endif
%post
if [ "$1" -le "1" ] ; then # First install
%if %{with_systemd}
%systemd_post restraintd
# Enable restraintd by default
/bin/systemctl enable restraintd.service >/dev/null 2>&1 || :
%else
chkconfig --level 345 restraintd on
%endif
%if %{with_selinux_policy}
semodule -i %{_datadir}/selinux/packages/%{name}/restraint.pp || :
%endif
fi
%post rhts
if [ "$1" -le "1" ] ; then # First install
%if 0%{?rhel}%{?fedora} > 4
semodule -i %{_datadir}/selinux/packages/%{name}/rhts.pp || :
%endif
fi
%preun
if [ "$1" -lt "1" ] ; then # Final removal
%if %{with_systemd}
%systemd_preun %{_services}
%else
chkconfig --del restraintd || :
%endif
%if %{with_selinux_policy}
semodule -r restraint || :
%endif
fi
%preun rhts
if [ "$1" -lt "1" ] ; then # Final removal
%if 0%{?rhel}%{?fedora} > 4
semodule -r rhts || :
%endif
fi
%postun
if [ "$1" -ge "1" ] ; then # Upgrade
%if %{with_systemd}
%systemd_postun_with_restart %{_services_restart}
%else
service restraintd condrestart >/dev/null 2>&1 || :
%endif
%if %{with_selinux_policy}
semodule -i %{_datadir}/selinux/packages/%{name}/restraint.pp || :
%endif
fi
%postun rhts
if [ "$1" -ge "1" ] ; then # Upgrade
%if 0%{?rhel}%{?fedora} > 4
semodule -i %{_datadir}/selinux/packages/%{name}/rhts.pp || :
%endif
fi
%files
%defattr(-,root,root,-)
%if %{with_systemd}
%attr(0755, root, root)%{_unitdir}/%{name}d.service
%exclude %{_sysconfdir}/init.d
%else
%exclude /usr/lib/systemd
%attr(0755, root, root)%{_sysconfdir}/init.d/%{name}d
%endif
%attr(0755, root, root)%{_bindir}/%{name}d
%attr(0755, root, root)%{_bindir}/rstrnt-report-result
%attr(0755, root, root)%{_bindir}/rstrnt-report-log
%attr(0755, root, root)%{_bindir}/rstrnt-backup
%attr(0755, root, root)%{_bindir}/rstrnt-restore
%attr(0755, root, root)%{_bindir}/rstrnt-reboot
%attr(0755, root, root)%{_bindir}/check_beaker
%attr(0755, root, root)%{_bindir}/rstrnt-adjust-watchdog
/usr/share/%{name}
/usr/share/%{name}/plugins/run_plugins
/usr/share/%{name}/plugins/run_task_plugins
/usr/share/%{name}/plugins/localwatchdog.d
/usr/share/%{name}/plugins/completed.d
/usr/share/%{name}/plugins/report_result.d
/usr/share/%{name}/plugins/task_run.d
/var/lib/%{name}
%if %{with_selinux_policy}
%{_datadir}/selinux/packages/%{name}/restraint.pp
%endif
%files client
%attr(0755, root, root)%{_bindir}/%{name}
/usr/share/%{name}/client/job2junit.xml
/usr/share/%{name}/client/job2html.xml
/usr/share/%{name}/client/bootstrap/LICENSE
/usr/share/%{name}/client/bootstrap/README
/usr/share/%{name}/client/bootstrap/bootstrap.min.css
%files rhts
%defattr(-,root,root,-)
%attr(0755, root, root)%{_bindir}/rhts-environment.sh
%attr(0755, root, root)%{_bindir}/rhts_environment.sh
%attr(0755, root, root)%{_bindir}/rhts-reboot
%attr(0755, root, root)%{_bindir}/rhts-report-result
%attr(0755, root, root)%{_bindir}/rhts-submit-log
%attr(0755, root, root)%{_bindir}/rhts_submit_log
%attr(0755, root, root)%{_bindir}/rhts-run-simple-test
%attr(0755, root, root)%{_bindir}/rhts-backup
%attr(0755, root, root)%{_bindir}/rhts-restore
%attr(0755, root, root)%{_bindir}/rhts-restore
%attr(0755, root, root)%{_bindir}/rhts-lint
%attr(0755, root, root)%{_bindir}/rhts-sync-set
%attr(0755, root, root)%{_bindir}/rhts-sync-block
%attr(0755, root, root)%{_bindir}/rhts-recipe-sync-set
%attr(0755, root, root)%{_bindir}/rhts-recipe-sync-block
%{_datadir}/rhts/lib/rhts-make.include
/mnt/scratchspace
%attr(1777,root,root)/mnt/testarea
%if 0%{?rhel}%{?fedora} > 4
%{_datadir}/selinux/packages/%{name}/rhts.pp
%endif
%clean
%{__rm} -rf %{buildroot}
%changelog
* Fri Sep 12 2014 Bill Peck <[email protected]> 0.1.17-2
- Update Authors ([email protected])
- Recipe roles in client. ([email protected])
- Fix duplicate task/params in client. ([email protected])
- fix restraint client help ([email protected])
* Wed Sep 10 2014 Bill Peck <[email protected]> 0.1.17-1
- Include an xslt template which will convert job.xml to junit.xml
- Bug: 1077115, fix blatently stole from beah fix ([email protected])
- If staf is installed then start it ([email protected])
- RecipeData init while copying xml template. ([email protected])
- Untie recipe_id from rundir_id. ([email protected])
- Documentation update. ([email protected])
- Creating task/params in copy_job_as_template(). ([email protected])
- Quitting loop on last aborted task. ([email protected])
- Switched to ids instead of wboards ([email protected])
- copying "role" attr in copy_task_nodes() ([email protected])
- "port" option fixed ([email protected])
- restraint client use a single "server" ([email protected])
- Log paths in job.xml fix ([email protected])
- Fixed premature quit on a problem with a single recipe. ([email protected])
- exit if failed to init recipe ([email protected])
- Cleaning up extra whiteboards. ([email protected])
- Default wboard value for recipes with undefined wb. ([email protected])
- parse_new_job() wboard memleak fix ([email protected])
- Initial mh support for restraint client. ([email protected])
- restraintd: config_port memleak fix ([email protected])
- Make find_recipe() return specific recipe. ([email protected])
- Storing actual uri in recipe_hosts hash table. ([email protected])
- Added host cmd line option to restraint client. ([email protected])
- Merge pull request #12 from jstancek/ppc64le_v1 ([email protected])
- cmd_result tried to free a pointer returned by getenv in case when outputfile
is supplied by env variable. filename and outputfilename vars are now freed
in callback_outputfile prior to another allocation. ([email protected])
- Fix segfault if task->metadata is NULL also fix parse_time_string to allow
for raw seconds to be passed in. ([email protected])
- fix test_fetch_git to propagate error ([email protected])
- Bunch of cmd_result fixes. ([email protected])
- Bunch of cmd_log fixes. ([email protected])
- Bunch of cmd_watchdog fixes. ([email protected])
- Proper cleanup of parsed arguments. ([email protected])
- Proper freeing of restraint client's AppData ([email protected])
- Fixed xmlXPathObjectPtr leak in parse_new_job() ([email protected])
- client.c multiple ghashtable memleaks fixed. ([email protected])
- client.c multiple gobject memleaks fixed. ([email protected])
- client.c multiple string memleaks fixed. ([email protected])
- Move unref to after if statement since on error reqh will be none
- Update skipped tests when thttpd is not installed ([email protected])
- Fix memory leaks in test_dependency test case ([email protected])
- Merge pull request #8 from sm00th/memleaks ([email protected])
- Fixed premature g_clear_error() ([email protected])
- Fixed infinite loop in task_handler() ([email protected])
- Freeing task metadata on task free. ([email protected])
- Added libsoup valgrind suppressions. ([email protected])
- Freeing task_run_data in task_finish_plugin_callback() ([email protected])
- Freeing server_data in plugin_finish_callback() ([email protected])
- Fixed string leak in server_recipe_callback() ([email protected])
- Fixed iochannel leak in process_run() ([email protected])
- Fixed string leak in message_complete() ([email protected])
- config.c error leak fix ([email protected])
- fixed GHashTable leak in server_control_callback() ([email protected])
- freeing temp string in restraint_task_watchdog() ([email protected])
- recipe_handler() proper cleanup in RECIPE_RUNNING state ([email protected])
- restraintd server graceful exit on termination. ([email protected])
- Rework install_dependencies to make it so we can unit test it.
- restructure of metadata values ([email protected])
- xmlparser free order fix in recipe_handler() ([email protected])
- g_string memleak fix in recipe_handler and task_handler ([email protected])
- add support for ppc64le ([email protected])
- test_packages is covered under test_process ([email protected])
- refactored async calls to be more like async calls. :-) ([email protected])
- rework fetch_git code to be independent and use callbacks for logic.
- Update Authors file ([email protected])
- Update TODO ([email protected])
- fix memory leaks ([email protected])
- fix uploading of result logs ([email protected])
- minor cleanup. we don't have to worry about initializing localwatchdog since
it's set in process_finish_callback and if we fail to fork it will get
asseted on success. ([email protected])
- fix check target in Makefiles ([email protected])
- Added local watchdog pass/fail to test_process.c
- Added test_process ([email protected])
- Allow beaker lab controller and recipe variables to be overridden via cmdline
- Change rstrnt-report-result to use filename when -o is used.
- Updates using restraint docs. ([email protected])
* Tue Jun 03 2014 Bill Peck <[email protected]> 0.1.16-1
- client package doesn't need the daemon to be installed. ([email protected])
- fix possible memory leak when trying to open both ipv4 and ipv6 sockets
- use correct path to job.xml and for index.html ([email protected])
- use index.html as output instead of results.html ([email protected])
- update Makefiles to install client files ([email protected])
- updates for move to /usr/share/restraint/client ([email protected])
- move client files out of docs ([email protected])
- generate pretty html from job.xml ([email protected])
- update version string in path to CSS files ([email protected])
- update rpm spec for bootstrap CSS files ([email protected])
- add local copy of bootstrap min CSS source ([email protected])
- add link to bootstrap CSS framework ([email protected])
* Thu May 29 2014 Jeff Bastian <[email protected]> 0.1.15-2
- add local copy of boostrap CSS
- automatically generate results.html from job.xml (when running from client)
* Wed May 28 2014 Bill Peck <[email protected]> 0.1.15-1
- Add IPv6 support ([email protected])
- If we fail to send a message because of a client issue, don't keep retrying.
- Remove hard coded server port. ([email protected])
* Mon May 05 2014 Bill Peck <[email protected]> 0.1.14-1
- Updated usecases ([email protected])
- Allow multiple versions of restraint to run if different ports are used.
- install task run plugin ([email protected])
- update TODO file ([email protected])
- Update features list ([email protected])
- Updates to plugin docs to match newest plugins. ([email protected])
- Add git clone info to docs ([email protected])
- Setup some environment variables if they aren't defined. Make the plugin
reporting a little clearer. ([email protected])
- fixes for watchdog adjust ([email protected])
- final pieces to support extending watchdog from reserve task.
- Allow tasks to disable localwatchdog. ([email protected])
- Only report denials in avc_check. ([email protected])
- Update static build requires to pick up fedora ([email protected])
- Pass OUTPUTFILE to rstrnt-report-result in case the variable wasn't exported
- minor doc updates ([email protected])
- Provide SUBMITTER for legacy rhts and RSTRNT_OWNER for new.
- minor fix for RSTRNT_RECIPE_URL ([email protected])
- Another variable that legacy rhts expects. ([email protected])
- define RSTRNT_RECIPE_URL so that tasks can request the current recipe xml.
- Define RESULT_SERVER for rhts legacy tasks. The value shouldn't matter.
- Display the commands being executed ([email protected])
- License Restraint under the GPL 3.0 ([email protected])
- Propagate the error when we fail a command returns non-zero
* Thu Apr 17 2014 Bill Peck <[email protected]> 0.1.13-1
- cosmetic change ([email protected])
- Fix guint64 mistake ([email protected])
- report the number seconds we are pushing the watchdog out. Should help with
debugging. ([email protected])
- Support added to allow tasks to use an alternate max time via task params.
looks for both KILLTIMEOVERRIDE and RSTRNT_MAX_TIME ([email protected])
- fixes to %%post scripts ([email protected])
- Minor updates to doc. ([email protected])
- Always populate the RSTRNT_* variables to make it easier to migrate.
- Fix %%post scripts to start restraintd ([email protected])
- Updates to the documentation ([email protected])
- Add beakerlib reporting support ([email protected])
- Fix env variable generation when prefix is NULL. ([email protected])
- Minor update to expected output ([email protected])
* Wed Apr 09 2014 Bill Peck <[email protected]> 0.1.12-1
- error checking on client to make sure we can make the run dir.
- Better client feedback ([email protected])
- Don't create variables if value is NULL fix metadata parser to use defaults
if key is missing. ([email protected])
* Thu Apr 03 2014 Bill Peck <[email protected]> 0.1.11-1
- only pass disable_plugin if plugins have been disabled ([email protected])
- add dummy rhts-lint to allow us to make testinfo.desc ([email protected])
- Updated service file to depend on network being online ([email protected])
- separate restraint into client package ([email protected])
- Report any errors at recipe level. ([email protected])
* Mon Mar 31 2014 Bill Peck <[email protected]> 0.1.10-1
- allow report_plugins to be disabled ([email protected])
- fix TESTID setting ([email protected])
- Add TESTID for legacy/beakerlib runs. ([email protected])
- Added selinux plugin check ([email protected])
* Tue Mar 25 2014 Bill Peck <[email protected]> 0.1.9-1
- Update the documentation to match how restraint works stand alone now.
- minor output change ([email protected])
- minor tweaks to plugins to use proper names ([email protected])
- update gitignore and remove docs/_build ([email protected])
- fix logging ([email protected])
- Install task dependencies, this is important for running outside of beaker.
- minor grammer and spelling mistakes ([email protected])
- Started docs. Documented plugins. ([email protected])
* Thu Mar 20 2014 Bill Peck <[email protected]> 0.1.8-1
- allow client.c to compile on rhel4 and exclude /usr/lib/systemd on none-
systemd systems ([email protected])
* Thu Mar 20 2014 Bill Peck <[email protected]> 0.1.7-1
- fixes for systemd ([email protected])
- use /var/lib/restraint for running state config. also record logs in
standalone job xml. ([email protected])
- fix comment ([email protected])
- Log errors to /dev/console and all messages to /var/log/restraintd.log
- Changes to support running stand alone better ([email protected])
- disable g_io_channel decoding which can barf on binary data.
* Thu Jan 23 2014 Bill Peck <[email protected]> 0.1.6-1
- revert spec file changes so tito doesn't get confused. ([email protected])
- fix legacy report_result. Was not passing args with quotes
- patch to fix /usr/lib64 to /usr/lib for libffi ([email protected])
- build libxml2 without python support ([email protected])
- also update libxml2-2.9.1 for aarch64 ([email protected])
- update third-party to libffi-3.0.13 ([email protected])
- Add IPV6 to TODO list ([email protected])
- Add TODO list. ([email protected])
* Tue Jan 21 2014 Bill Peck <[email protected]> 0.1.5-1
- fix make clean targets ([email protected])
- fix fd leak ([email protected])
- fix path for backup/restore ([email protected])
- More legacy variables ([email protected])
- fix reporting of which plugins are in use. ([email protected])
- Fix entry_point to be an array of strings to pass into process
- Introduced task runner plugins ([email protected])
- Fix running plugins (both localwatchdog and report_result) ([email protected])
- use NULL term value ([email protected])
* Thu Jan 09 2014 Bill Peck <[email protected]> 0.1.4-1
- Move localwatchdog plugins to a more generic plugins model.
- Provide TESTNAME and TESTPATH for legacy rhts ([email protected])
- Update build instructions ([email protected])
- ignore whitespace in scan. ([email protected])
- Look for a guestrecipe if we fail to find a regular recipe.
- Include rhts-run-simple-test from rhts. ([email protected])
- Update ignore to restrnt names ([email protected])
- Remember localwatchdog state, the plugins may reboot the system.
- disable requeueing messages for now. ([email protected])
- use guint64 ([email protected])
- Move rhts legacy into a sub-package ([email protected])
- Activate service after install ([email protected])
- fix buildroot ([email protected])
- Install localwatchdog plugins ([email protected])
* Wed Dec 18 2013 Bill Peck <[email protected]> 0.1.3-1
- Added localwatchdog plugins ([email protected])
- ignore pyc file from tito ([email protected])
- hack to tito build to add the third-party tarballs into the release.
- Updates to allow restraint to build from rhel4-rhel7 on all arches we care
about. ([email protected])
- few more places to switch from guint64 to gulong. ([email protected])
- Use unsigned long. ([email protected])
- Add missing BuildRequies to spec ([email protected])
- link process.o into restraintd fix install to create dirs really simple spec
file ([email protected])
- Make it easy to grab all the tarballs needed for static linking.
* Tue Dec 17 2013 Bill Peck <[email protected]> 0.1.2-1
- new package built with tito