1#!/bin/sh
2#
3#       aegis - project change supervisor
4#       Copyright (C) 2002, 2004-2008, 2012 Peter Miller
5#       Copyright (C) 2008, 2010 Walter Franzini
6#
7#       This program is free software; you can redistribute it and/or modify
8#       it under the terms of the GNU General Public License as published by
9#       the Free Software Foundation; either version 3 of the License, or
10#       (at your option) any later version.
11#
12#       This program is distributed in the hope that it will be useful,
13#       but WITHOUT ANY WARRANTY; without even the implied warranty of
14#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15#       GNU General Public License for more details.
16#
17#       You should have received a copy of the GNU General Public License
18#       along with this program. If not, see
19#       <http://www.gnu.org/licenses/>.
20#
21
22unset AEGIS_PROJECT
23unset AEGIS_CHANGE
24unset AEGIS_PATH
25unset AEGIS
26unset LINES
27unset COLS
28umask 022
29
30USER=${USER:-${LOGNAME:-`whoami`}}
31
32work=${AEGIS_TMP:-/tmp}/$$
33
34here=`pwd`
35if test $? -ne 0 ; then exit 2; fi
36
37if test "$1" != "" ; then bin="$here/$1/bin"; else bin="$here/bin"; fi
38
39if test "$EXEC_SEARCH_PATH" != ""
40then
41    tpath=
42    hold="$IFS"
43    IFS=":$IFS"
44    for tpath2 in $EXEC_SEARCH_PATH
45    do
46        tpath=${tpath}${tpath2}/${1-.}/bin:
47    done
48    IFS="$hold"
49    PATH=${tpath}${PATH}
50else
51    PATH=${bin}:${PATH}
52fi
53export PATH
54
55check_it()
56{
57        sed     -e "s|$work|...|g" \
58                -e 's|= 0; /.*|= TIME_NOT_SET;|' \
59                -e 's|= [0-9][0-9]*; /.*|= TIME;|' \
60                -e "s/\"$USER\"/\"USER\"/g" \
61                -e 's/19[0-9][0-9]/YYYY/' \
62                -e 's/20[0-9][0-9]/YYYY/' \
63                -e 's/node = ".*"/node = "NODE"/' \
64                -e 's/crypto = ".*"/crypto = "GUNK"/' \
65                -e 's/uuid = ".*"/uuid = "UUID"/' \
66                < $2 > $work/sed.out
67        if test $? -ne 0; then no_result; fi
68        diff -b $1 $work/sed.out
69        if test $? -ne 0; then fail; fi
70}
71
72no_result()
73{
74        set +x
75        echo "NO RESULT for test of aemt functionality ($activity)" 1>&2
76        cd $here
77        find $work -type d -user $USER -exec chmod u+w {} \;
78        rm -rf $work
79        exit 2
80}
81fail()
82{
83        set +x
84        echo "FAILED test of aemt functionality ($activity)" 1>&2
85        cd $here
86        find $work -type d -user $USER -exec chmod u+w {} \;
87        rm -rf $work
88        exit 1
89}
90pass()
91{
92        set +x
93        echo PASSED 1>&2
94        cd $here
95        find $work -type d -user $USER -exec chmod u+w {} \;
96        rm -rf $work
97        exit 0
98}
99trap "no_result" 1 2 3 15
100
101#
102# some variable to make things earier to read
103#
104PAGER=cat
105export PAGER
106
107AEGIS_FLAGS="delete_file_preference = no_keep; \
108        lock_wait_preference = always; \
109        diff_preference = automatic_merge; \
110        pager_preference = never; \
111        persevere_preference = all; \
112        log_file_preference = never;"
113export AEGIS_FLAGS
114AEGIS_THROTTLE=-1
115export AEGIS_THROTTLE
116
117worklib=$work/lib
118workproj=$work/foo.proj
119workchan=$work/foo.chan
120tmp=$work/tmp
121AEGIS_PATH=$worklib ; export AEGIS_PATH
122AEGIS_PROJECT=foo ; export AEGIS_PROJECT
123
124#
125# make the directories
126#
127activity="working directory 127"
128mkdir $work $work/lib
129if test $? -ne 0 ; then no_result; fi
130chmod 777 $work/lib
131if test $? -ne 0 ; then no_result; fi
132cd $work
133if test $? -ne 0 ; then no_result; fi
134
135#
136# use the built-in error messages
137#
138AEGIS_MESSAGE_LIBRARY=$work/no-such-dir
139export AEGIS_MESSAGE_LIBRARY
140unset LANG
141unset LANGUAGE
142
143#
144# make a new project
145#
146activity="new project 146"
147$bin/aegis -npr foo -vers "" -dir $workproj > log 2>&1
148if test $? -ne 0 ; then cat log; no_result; fi
149
150#
151# change project attributes
152#
153activity="project attributes 153"
154cat > $tmp << 'end'
155description = "A bogus project created to test the aemt functionality.";
156developer_may_review = true;
157developer_may_integrate = true;
158reviewer_may_integrate = true;
159default_test_exemption = true;
160end
161if test $? -ne 0 ; then no_result; fi
162$bin/aegis -pa -f $tmp > log 2>&1
163if test $? -ne 0 ; then cat log; no_result; fi
164
165#
166# add the staff
167#
168activity="staff 168"
169$bin/aegis -nd $USER > log 2>&1
170if test $? -ne 0 ; then cat log; no_result; fi
171$bin/aegis -nrv $USER > log 2>&1
172if test $? -ne 0 ; then cat log; no_result; fi
173$bin/aegis -ni $USER > log 2>&1
174if test $? -ne 0 ; then cat log; no_result; fi
175
176# --------------------------------------------------------------------------
177
178#
179# create a new change
180#
181activity="new change 181"
182cat > $tmp << 'end'
183brief_description = "The first change";
184cause = internal_bug;
185end
186if test $? -ne 0 ; then no_result; fi
187$bin/aegis -nc 1 -f $tmp -p foo > log 2>&1
188if test $? -ne 0 ; then cat log; no_result; fi
189
190#
191# begin development of a change
192#
193$bin/aegis -db 1 -dir $workchan > log 2>&1
194if test $? -ne 0 ; then cat log; no_result; fi
195
196#
197# add a new files to the change
198#
199activity="new file 199"
200$bin/aegis -nf  $workchan/aegis.conf $workchan/bogus -nl > log 2>&1
201if test $? -ne 0 ; then cat log; no_result; fi
202
203cat > $workchan/bogus << 'end'
204the trunk version
205end
206if test $? -ne 0 ; then no_result; fi
207
208cat > $workchan/aegis.conf << 'end'
209build_command = "exit 0";
210link_integration_directory = true;
211
212history_get_command = "aesvt -check-out -edit ${quote $edit} "
213    "-history ${quote $history} -f ${quote $output}";
214history_put_command = "aesvt -check-in -history ${quote $history} "
215    "-f ${quote $input}";
216history_query_command = "aesvt -query -history ${quote $history}";
217history_content_limitation = binary_capable;
218
219diff_command = "set +e; diff $orig $i > $out; test $$? -le 1";
220diff3_command = "(diff3 -e $mr $orig $i | sed -e '/^w$$/d' -e '/^q$$/d'; \
221        echo '1,$$p' ) | ed - $mr > $out";
222patch_diff_command = "set +e; diff -C0 -L $index -L $index $orig $i > $out; \
223test $$? -le 1";
224end
225if test $? -ne 0 ; then no_result; fi
226
227#
228# build the change
229#
230activity="build 230"
231$bin/aegis -build -nl -v > log 2>&1
232if test $? -ne 0 ; then cat log; fail; fi
233
234#
235# difference the change
236#
237activity="diff 237"
238$bin/aegis -diff > log 2>&1
239if test $? -ne 0 ; then cat log; no_result; fi
240
241#
242# finish development of the change
243#
244activity="develop end 244"
245$bin/aegis -de > log 2>&1
246if test $? -ne 0 ; then cat log; fail; fi
247
248#
249# pass the review
250#
251activity="review pass 251"
252$bin/aegis -rpass -c 1 > log 2>&1
253if test $? -ne 0 ; then cat log; no_result; fi
254
255#
256# start integrating
257#
258activity="integrate begin 258"
259$bin/aegis -ib 1 > log 2>&1
260if test $? -ne 0 ; then cat log; no_result; fi
261
262#
263# integrate build
264#
265activity="build 265"
266$bin/aegis -b -nl -v > log 2>&1
267if test $? -ne 0 ; then cat log; no_result; fi
268
269#
270# pass the integration
271#
272activity="integrate pass 272"
273$bin/aegis -intpass -nl > log 2>&1
274if test $? -ne 0 ; then cat log; no_result; fi
275
276# --------------------------------------------------------------------------
277
278#
279# create a branch
280#
281activity="new branch 281"
282$bin/aegis -nbr -p foo 2 > log 2>&1
283if test $? -ne 0 ; then cat log; no_result; fi
284
285AEGIS_PROJECT=foo.2
286export AEGIS_PROJECT
287
288# --------------------------------------------------------------------------
289
290#
291# create a new change
292#
293activity="new change 293"
294cat > $tmp << 'end'
295brief_description = "The second change";
296cause = internal_bug;
297end
298if test $? -ne 0 ; then no_result; fi
299$bin/aegis -nc 3 -f $tmp -p foo.2 > log 2>&1
300if test $? -ne 0 ; then cat log; no_result; fi
301
302#
303# begin development of a change
304#
305$bin/aegis -db 3 -dir $workchan > log 2>&1
306if test $? -ne 0 ; then cat log; no_result; fi
307
308#
309# add files to the change
310#
311activity="copy file 311"
312$bin/aegis -cp  $workchan/bogus -nl > log 2>&1
313if test $? -ne 0 ; then cat log; no_result; fi
314
315cat > $workchan/bogus << 'end'
316the branch version
317end
318if test $? -ne 0 ; then no_result; fi
319
320#
321# build the change
322#
323activity="build 323"
324$bin/aegis -build -nl -v > log 2>&1
325if test $? -ne 0 ; then cat log; fail; fi
326
327#
328# difference the change
329#
330activity="diff 330"
331$bin/aegis -diff > log 2>&1
332if test $? -ne 0 ; then cat log; no_result; fi
333
334#
335# finish development of the change
336#
337activity="develop end 337"
338$bin/aegis -de > log 2>&1
339if test $? -ne 0 ; then cat log; fail; fi
340
341#
342# pass the review
343#
344activity="review pass 344"
345$bin/aegis -rpass -c 3 > log 2>&1
346if test $? -ne 0 ; then cat log; no_result; fi
347
348#
349# start integrating
350#
351activity="integrate begin 351"
352$bin/aegis -ib 3 > log 2>&1
353if test $? -ne 0 ; then cat log; no_result; fi
354
355#
356# integrate build
357#
358activity="build 358"
359$bin/aegis -b -nl -v > log 2>&1
360if test $? -ne 0 ; then cat log; no_result; fi
361
362#
363# integrate diff
364#
365activity="diff 365"
366$bin/aegis -diff -nl -v > log 2>&1
367if test $? -ne 0 ; then cat log; no_result; fi
368
369#
370# pass the integration
371#
372activity="integrate pass 372"
373$bin/aegis -intpass -nl > log 2>&1
374if test $? -ne 0 ; then cat log; no_result; fi
375
376# --------------------------------------------------------------------------
377
378#
379# create a new change
380#
381activity="new change 381"
382cat > $tmp << 'end'
383brief_description = "The third change";
384cause = internal_bug;
385end
386if test $? -ne 0 ; then no_result; fi
387$bin/aegis -nc 4 -f $tmp -p foo.2 > log 2>&1
388if test $? -ne 0 ; then cat log; no_result; fi
389
390#
391# begin development of a change
392#
393$bin/aegis -db 4 -dir $workchan > log 2>&1
394if test $? -ne 0 ; then cat log; no_result; fi
395
396#
397# add files to the change
398#
399activity="make transparent 399"
400$bin/aegis -mt $workchan/bogus -nl > log 2>&1
401if test $? -ne 0 ; then cat log; fail; fi
402
403activity="check file contents 403"
404cat > ok << 'end'
405the trunk version
406end
407if test $? -ne 0 ; then no_result; fi
408
409diff ok $workchan/bogus
410if test $? -ne 0 ; then fail; fi
411
412activity="check change file state 412"
413cat > ok << 'end'
414src =
415[
416        {
417                file_name = "bogus";
418                uuid = "UUID";
419                action = transparent;
420                edit_origin =
421                {
422                        revision = "2";
423                        encoding = none;
424                        uuid = "UUID";
425                };
426                usage = source;
427        },
428];
429end
430if test $? -ne 0 ; then no_result; fi
431
432check_it ok $workproj/info/change/0/002.branch/0/004.fs
433
434#
435# build
436#
437activity="build 437"
438$bin/aegis -build -nl > log 2>&1
439if test $? -ne 0 ; then cat log; fail; fi
440
441activity="check change state 441"
442cat > ok << 'end'
443brief_description = "The third change";
444description = "The third change";
445cause = internal_bug;
446test_exempt = true;
447test_baseline_exempt = true;
448regression_test_exempt = true;
449architecture =
450[
451        "unspecified",
452];
453state = being_developed;
454given_test_exemption = true;
455given_regression_test_exemption = true;
456project_file_command_sync = 88;
457development_directory = ".../foo.chan";
458history =
459[
460        {
461                when = TIME;
462                what = new_change;
463                who = "USER";
464        },
465        {
466                when = TIME;
467                what = develop_begin;
468                who = "USER";
469        },
470];
471end
472if test $? -ne 0 ; then no_result; fi
473
474check_it ok $workproj/info/change/0/002.branch/0/004
475
476#
477# diff
478#
479activity="diff 479"
480$bin/aegis -diff -nl > log 2>&1
481if test $? -ne 0 ; then cat log; fail; fi
482
483activity="check change state 483"
484cat > ok << 'end'
485brief_description = "The third change";
486description = "The third change";
487cause = internal_bug;
488test_exempt = true;
489test_baseline_exempt = true;
490regression_test_exempt = true;
491architecture =
492[
493        "unspecified",
494];
495state = being_developed;
496given_test_exemption = true;
497given_regression_test_exemption = true;
498project_file_command_sync = 88;
499development_directory = ".../foo.chan";
500history =
501[
502        {
503                when = TIME;
504                what = new_change;
505                who = "USER";
506        },
507        {
508                when = TIME;
509                what = develop_begin;
510                who = "USER";
511        },
512];
513end
514if test $? -ne 0 ; then no_result; fi
515
516check_it ok $workproj/info/change/0/002.branch/0/004
517
518activity="check change file state 518"
519cat > ok << 'end'
520src =
521[
522        {
523                file_name = "bogus";
524                uuid = "UUID";
525                action = transparent;
526                edit_origin =
527                {
528                        revision = "2";
529                        encoding = none;
530                        uuid = "UUID";
531                };
532                usage = source;
533                file_fp =
534                {
535                        youngest = TIME;
536                        oldest = TIME;
537                        crypto = "GUNK";
538                };
539                diff_file_fp =
540                {
541                        youngest = TIME;
542                        oldest = TIME;
543                        crypto = "GUNK";
544                };
545        },
546];
547end
548if test $? -ne 0 ; then no_result; fi
549
550check_it ok $workproj/info/change/0/002.branch/0/004.fs
551
552#
553# develop end
554#
555activity="develop end 555"
556$bin/aegis -de > log 2>&1
557if test $? -ne 0 ; then cat log; fail; fi
558
559activity="check change file state 559"
560cat > ok << 'end'
561src =
562[
563        {
564                file_name = "bogus";
565                uuid = "UUID";
566                action = transparent;
567                edit_origin =
568                {
569                        revision = "2";
570                        encoding = none;
571                        uuid = "UUID";
572                };
573                usage = source;
574                file_fp =
575                {
576                        youngest = TIME;
577                        oldest = TIME;
578                        crypto = "GUNK";
579                };
580                diff_file_fp =
581                {
582                        youngest = TIME;
583                        oldest = TIME;
584                        crypto = "GUNK";
585                };
586        },
587];
588end
589if test $? -ne 0 ; then no_result; fi
590
591check_it ok $workproj/info/change/0/002.branch/0/004.fs
592
593activity="check change state 593"
594cat > ok << 'end'
595brief_description = "The third change";
596description = "The third change";
597cause = internal_bug;
598test_exempt = true;
599test_baseline_exempt = true;
600regression_test_exempt = true;
601architecture =
602[
603        "unspecified",
604];
605state = being_reviewed;
606given_test_exemption = true;
607given_regression_test_exemption = true;
608project_file_command_sync = 88;
609development_directory = ".../foo.chan";
610history =
611[
612        {
613                when = TIME;
614                what = new_change;
615                who = "USER";
616        },
617        {
618                when = TIME;
619                what = develop_begin;
620                who = "USER";
621        },
622        {
623                when = TIME;
624                what = develop_end;
625                who = "USER";
626        },
627];
628end
629if test $? -ne 0 ; then no_result; fi
630
631check_it ok $workproj/info/change/0/002.branch/0/004
632
633activity="check branch file state 633"
634cat > ok << 'end'
635src =
636[
637        {
638                file_name = "bogus";
639                uuid = "UUID";
640                action = modify;
641                edit =
642                {
643                        revision = "2";
644                        encoding = none;
645                        uuid = "UUID";
646                };
647                edit_origin =
648                {
649                        revision = "1";
650                        encoding = none;
651                        uuid = "UUID";
652                };
653                usage = source;
654                file_fp =
655                {
656                        youngest = TIME;
657                        oldest = TIME;
658                        crypto = "GUNK";
659                };
660                diff_file_fp =
661                {
662                        youngest = TIME;
663                        oldest = TIME;
664                        crypto = "GUNK";
665                };
666                locked_by = 4;
667        },
668];
669end
670if test $? -ne 0 ; then no_result; fi
671
672check_it ok $workproj/info/change/0/002.fs
673
674#
675# review pass
676#
677activity="review pass 677"
678$bin/aegis --review-pass 4 > log 2>&1
679if test $? -ne 0 ; then cat log; fail; fi
680
681#
682# integrate begin
683#
684activity="integrate begin 684"
685$bin/aegis --integrate-begin 4 > log 2>&1
686if test $? -ne 0 ; then cat log; fail; fi
687
688#
689# build
690#
691activity="build 691"
692$bin/aegis -build -nl > log 2>&1
693if test $? -ne 0 ; then cat log; fail; fi
694
695#
696# diff
697#
698activity="diff 698"
699$bin/aegis -diff -nl > log 2>&1
700if test $? -ne 0 ; then cat log; fail; fi
701
702#
703# pass the integration
704#
705activity="integrate pass 705"
706$bin/aegis -intpass -nl > log 2>&1
707if test $? -ne 0 ; then cat log; no_result; fi
708
709activity="check change file state 709"
710cat > ok << 'end'
711src =
712[
713        {
714                file_name = "bogus";
715                uuid = "UUID";
716                action = transparent;
717                edit_origin =
718                {
719                        revision = "2";
720                        encoding = none;
721                        uuid = "UUID";
722                };
723                usage = source;
724        },
725];
726end
727if test $? -ne 0 ; then no_result; fi
728
729check_it ok $workproj/info/change/0/002.branch/0/004.fs
730
731activity="check change state 731"
732cat > ok << 'end'
733brief_description = "The third change";
734description = "The third change";
735cause = internal_bug;
736test_exempt = true;
737test_baseline_exempt = true;
738regression_test_exempt = true;
739architecture =
740[
741        "unspecified",
742];
743copyright_years =
744[
745        YYYY,
746];
747attribute =
748[
749        {
750                name = "aegis:history_get_command";
751                value = "aesvt -check-out -edit ${quote $edit} -history ${quote $history} -f ${quote $output}";
752        },
753];
754state = completed;
755given_test_exemption = true;
756given_regression_test_exemption = true;
757delta_number = 2;
758delta_uuid = "UUID";
759minimum_integration = true;
760project_file_command_sync = 88;
761history =
762[
763        {
764                when = TIME;
765                what = new_change;
766                who = "USER";
767        },
768        {
769                when = TIME;
770                what = develop_begin;
771                who = "USER";
772        },
773        {
774                when = TIME;
775                what = develop_end;
776                who = "USER";
777        },
778        {
779                when = TIME;
780                what = review_pass;
781                who = "USER";
782        },
783        {
784                when = TIME;
785                what = integrate_begin;
786                who = "USER";
787        },
788        {
789                when = TIME;
790                what = integrate_pass;
791                who = "USER";
792        },
793];
794uuid = "UUID";
795end
796if test $? -ne 0 ; then no_result; fi
797
798check_it ok $workproj/info/change/0/002.branch/0/004
799
800activity="check branch file state 800"
801cat > ok << 'end'
802src =
803[
804        {
805                file_name = "bogus";
806                uuid = "UUID";
807                action = transparent;
808                edit =
809                {
810                        revision = "2";
811                        encoding = none;
812                        uuid = "UUID";
813                };
814                edit_origin =
815                {
816                        revision = "1";
817                        encoding = none;
818                        uuid = "UUID";
819                };
820                usage = source;
821        },
822];
823end
824if test $? -ne 0 ; then no_result; fi
825
826check_it ok $workproj/info/change/0/002.fs
827
828# ==========================================================================
829#
830# Now the tricky part: ending the branch.
831#
832AEGIS_PROJECT=foo
833export AEGIS_PROJECT
834
835#
836# develop end
837#
838activity="develop end 838"
839$bin/aegis -de 2 > log 2>&1
840if test $? -ne 0 ; then cat log; fail; fi
841
842activity="check change file state 842"
843cat > ok << 'end'
844src =
845[
846        {
847                file_name = "bogus";
848                uuid = "UUID";
849                action = transparent;
850                edit =
851                {
852                        revision = "2";
853                        encoding = none;
854                        uuid = "UUID";
855                };
856                edit_origin =
857                {
858                        revision = "1";
859                        encoding = none;
860                        uuid = "UUID";
861                };
862                usage = source;
863        },
864];
865end
866if test $? -ne 0 ; then no_result; fi
867
868check_it ok $workproj/info/change/0/002.fs
869
870activity="check change state 870"
871cat > ok << 'end'
872brief_description = "A bogus project created to test the aemt functionality, branch 2.";
873description = "A bogus project created to test the aemt functionality, branch 2.";
874cause = internal_enhancement;
875test_exempt = true;
876test_baseline_exempt = true;
877regression_test_exempt = true;
878architecture =
879[
880        "unspecified",
881];
882copyright_years =
883[
884        YYYY,
885];
886state = being_reviewed;
887architecture_times =
888[
889];
890development_directory = "branch.2";
891history =
892[
893        {
894                when = TIME;
895                what = new_change;
896                who = "USER";
897        },
898        {
899                when = TIME;
900                what = develop_begin;
901                who = "USER";
902        },
903        {
904                when = TIME;
905                what = develop_end;
906                who = "USER";
907        },
908];
909branch =
910{
911        umask = 022;
912        developer_may_review = true;
913        developer_may_integrate = true;
914        reviewer_may_integrate = true;
915        developers_may_create_changes = false;
916        default_test_exemption = true;
917        default_test_regression_exemption = true;
918        skip_unlucky = false;
919        compress_database = false;
920        develop_end_action = goto_being_reviewed;
921        history =
922        [
923                {
924                        delta_number = 1;
925                        change_number = 3;
926                        uuid = "UUID";
927                        when = TIME;
928                        is_a_branch = no;
929                },
930                {
931                        delta_number = 2;
932                        change_number = 4;
933                        uuid = "UUID";
934                        when = TIME;
935                        is_a_branch = no;
936                },
937        ];
938        change =
939        [
940                3,
941                4,
942        ];
943        administrator =
944        [
945                "USER",
946        ];
947        developer =
948        [
949                "USER",
950        ];
951        reviewer =
952        [
953                "USER",
954        ];
955        integrator =
956        [
957                "USER",
958        ];
959        minimum_change_number = 10;
960        reuse_change_numbers = true;
961        minimum_branch_number = 1;
962        protect_development_directory = false;
963};
964end
965if test $? -ne 0 ; then no_result; fi
966
967check_it ok $workproj/info/change/0/002
968
969# The transparent file should NOT be locked
970# when its coming from a branch that it was transparent in.
971activity="check trunk file state 971"
972cat > ok << 'end'
973src =
974[
975        {
976                file_name = "aegis.conf";
977                uuid = "UUID";
978                action = create;
979                edit =
980                {
981                        revision = "1";
982                        encoding = none;
983                        uuid = "UUID";
984                };
985                edit_origin =
986                {
987                        revision = "1";
988                        encoding = none;
989                        uuid = "UUID";
990                };
991                usage = config;
992                file_fp =
993                {
994                        youngest = TIME;
995                        oldest = TIME;
996                        crypto = "GUNK";
997                };
998        },
999        {
1000                file_name = "bogus";
1001                uuid = "UUID";
1002                action = create;
1003                edit =
1004                {
1005                        revision = "1";
1006                        encoding = none;
1007                        uuid = "UUID";
1008                };
1009                edit_origin =
1010                {
1011                        revision = "1";
1012                        encoding = none;
1013                        uuid = "UUID";
1014                };
1015                usage = source;
1016                file_fp =
1017                {
1018                        youngest = TIME;
1019                        oldest = TIME;
1020                        crypto = "GUNK";
1021                };
1022        },
1023];
1024end
1025if test $? -ne 0 ; then no_result; fi
1026
1027check_it ok $workproj/info/trunk.fs
1028
1029#
1030# review pass
1031#
1032activity="review pass 1032"
1033$bin/aegis --review-pass 2 > log 2>&1
1034if test $? -ne 0 ; then cat log; fail; fi
1035
1036#
1037# integrate begin
1038#
1039activity="integrate begin 1039"
1040$bin/aegis --integrate-begin 2 > log 2>&1
1041if test $? -ne 0 ; then cat log; fail; fi
1042
1043#
1044# build
1045#
1046activity="build 1046"
1047$bin/aegis -build -nl > log 2>&1
1048if test $? -ne 0 ; then cat log; fail; fi
1049
1050#
1051# pass the integration
1052#
1053activity="integrate pass 1053"
1054$bin/aegis -intpass -nl 2 > log 2>&1
1055if test $? -ne 0 ; then cat log; no_result; fi
1056
1057activity="check change file state 1057"
1058cat > ok << 'end'
1059src =
1060[
1061        {
1062                file_name = "bogus";
1063                uuid = "UUID";
1064                action = transparent;
1065                edit =
1066                {
1067                        revision = "2";
1068                        encoding = none;
1069                        uuid = "UUID";
1070                };
1071                edit_origin =
1072                {
1073                        revision = "1";
1074                        encoding = none;
1075                        uuid = "UUID";
1076                };
1077                usage = source;
1078        },
1079];
1080end
1081if test $? -ne 0 ; then no_result; fi
1082
1083check_it ok $workproj/info/change/0/002.fs
1084
1085activity="check change state 1085"
1086cat > ok << 'end'
1087brief_description = "A bogus project created to test the aemt functionality, branch 2.";
1088description = "A bogus project created to test the aemt functionality, branch 2.";
1089cause = internal_enhancement;
1090test_exempt = true;
1091test_baseline_exempt = true;
1092regression_test_exempt = true;
1093architecture =
1094[
1095        "unspecified",
1096];
1097copyright_years =
1098[
1099        YYYY,
1100];
1101attribute =
1102[
1103        {
1104                name = "aegis:history_get_command";
1105                value = "aesvt -check-out -edit ${quote $edit} -history ${quote $history} -f ${quote $output}";
1106        },
1107];
1108state = completed;
1109delta_number = 2;
1110delta_uuid = "UUID";
1111minimum_integration = true;
1112history =
1113[
1114        {
1115                when = TIME;
1116                what = new_change;
1117                who = "USER";
1118        },
1119        {
1120                when = TIME;
1121                what = develop_begin;
1122                who = "USER";
1123        },
1124        {
1125                when = TIME;
1126                what = develop_end;
1127                who = "USER";
1128        },
1129        {
1130                when = TIME;
1131                what = review_pass;
1132                who = "USER";
1133        },
1134        {
1135                when = TIME;
1136                what = integrate_begin;
1137                who = "USER";
1138        },
1139        {
1140                when = TIME;
1141                what = integrate_pass;
1142                who = "USER";
1143        },
1144];
1145uuid = "UUID";
1146branch =
1147{
1148        umask = 022;
1149        developer_may_review = true;
1150        developer_may_integrate = true;
1151        reviewer_may_integrate = true;
1152        developers_may_create_changes = false;
1153        default_test_exemption = true;
1154        default_test_regression_exemption = true;
1155        skip_unlucky = false;
1156        compress_database = false;
1157        develop_end_action = goto_being_reviewed;
1158        history =
1159        [
1160                {
1161                        delta_number = 1;
1162                        change_number = 3;
1163                        uuid = "UUID";
1164                        when = TIME;
1165                        is_a_branch = no;
1166                },
1167                {
1168                        delta_number = 2;
1169                        change_number = 4;
1170                        uuid = "UUID";
1171                        when = TIME;
1172                        is_a_branch = no;
1173                },
1174        ];
1175        change =
1176        [
1177                3,
1178                4,
1179        ];
1180        administrator =
1181        [
1182                "USER",
1183        ];
1184        developer =
1185        [
1186                "USER",
1187        ];
1188        reviewer =
1189        [
1190                "USER",
1191        ];
1192        integrator =
1193        [
1194                "USER",
1195        ];
1196        minimum_change_number = 10;
1197        reuse_change_numbers = true;
1198        minimum_branch_number = 1;
1199        protect_development_directory = false;
1200};
1201end
1202if test $? -ne 0 ; then no_result; fi
1203
1204check_it ok $workproj/info/change/0/002
1205
1206activity="check trunk file state 1206"
1207cat > ok << 'end'
1208src =
1209[
1210        {
1211                file_name = "aegis.conf";
1212                uuid = "UUID";
1213                action = create;
1214                edit =
1215                {
1216                        revision = "1";
1217                        encoding = none;
1218                        uuid = "UUID";
1219                };
1220                edit_origin =
1221                {
1222                        revision = "1";
1223                        encoding = none;
1224                        uuid = "UUID";
1225                };
1226                usage = config;
1227                file_fp =
1228                {
1229                        youngest = TIME;
1230                        oldest = TIME;
1231                        crypto = "GUNK";
1232                };
1233        },
1234        {
1235                file_name = "bogus";
1236                uuid = "UUID";
1237                action = create;
1238                edit =
1239                {
1240                        revision = "1";
1241                        encoding = none;
1242                        uuid = "UUID";
1243                };
1244                edit_origin =
1245                {
1246                        revision = "1";
1247                        encoding = none;
1248                        uuid = "UUID";
1249                };
1250                usage = source;
1251        },
1252];
1253end
1254if test $? -ne 0 ; then no_result; fi
1255
1256check_it ok $workproj/info/trunk.fs
1257
1258#
1259# the things tested in this test, worked
1260# can't speak for the rest of the code
1261#
1262pass
1263# vim: set ts=8 sw=4 et :
1264