Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
7ae40c82
Commit
7ae40c82
authored
Nov 02, 2000
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Must insert the experiment into the database before running the tb scripts.
parent
aca0f001
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
37 deletions
+54
-37
www/beginexp_process.php3
www/beginexp_process.php3
+54
-37
No files found.
www/beginexp_process.php3
View file @
7ae40c82
...
...
@@ -7,6 +7,8 @@
<?php
include
(
"defs.php3"
);
$mydebug
=
1
;
#
# First off, sanity check the form to make sure all the required fields
# were provided. I do this on a per field basis so that we can be
...
...
@@ -123,6 +125,27 @@ if (! copy($exp_nsfile, "$nsname")) {
TBERROR
(
"Copying NS file for experiment into
$dirname
."
,
1
);
}
#
# So, that went okay. At this point enter the exp_id into the database
# so that it shows up as valid when the tb scripts run. We need to remove
# the entry if any of this fails!
#
$query_result
=
mysql_db_query
(
$TBDBNAME
,
"INSERT INTO experiments "
.
"(eid, pid, expt_created, expt_expires, expt_name, "
.
"expt_head_uid, expt_start, expt_end) "
.
"VALUES ('
$exp_id
', '
$exp_pid
', '
$exp_created
', '
$exp_expires
', "
.
"'
$exp_name
', '
$uid
', '
$exp_start
', '
$exp_end
')"
);
if
(
!
$query_result
)
{
if
(
!
$mydebug
)
{
unlink
(
"
$nsname
"
);
rmdir
(
"
$dirname
"
);
}
$err
=
mysql_error
();
TBERROR
(
"Database Error adding new experiment
$exp_id
:
$err
\n
"
,
1
);
}
echo
"<center><br>"
;
echo
"<h3>Setting up experiment. This may take a few minutes ...</h3>"
;
echo
"</center>"
;
...
...
@@ -149,25 +172,29 @@ if ($retval) {
}
echo
"</XMP>
\n
"
;
unlink
(
"
$nsname
"
);
if
(
file_exists
(
$irname
))
unlink
(
"
$irname
"
);
if
(
file_exists
(
$repname
))
unlink
(
"
$repname
"
);
if
(
file_exists
(
$logname
))
unlink
(
"
$logname
"
);
if
(
file_exists
(
$assname
))
unlink
(
"
$assname
"
);
if
(
file_exists
(
$dirname
))
rmdir
(
"
$dirname
"
);
$query_result
=
mysql_db_query
(
$TBDBNAME
,
"DELETE FROM experiments WHERE eid='
$exp_id
' and pid=
\"
$exp_pid
\"
"
);
if
(
!
$mydebug
)
{
unlink
(
"
$nsname
"
);
if
(
file_exists
(
$irname
))
unlink
(
"
$irname
"
);
if
(
file_exists
(
$repname
))
unlink
(
"
$repname
"
);
if
(
file_exists
(
$logname
))
unlink
(
"
$logname
"
);
if
(
file_exists
(
$assname
))
unlink
(
"
$assname
"
);
if
(
file_exists
(
$dirname
))
rmdir
(
"
$dirname
"
);
}
die
(
""
);
}
#
# Debugging!
#
if
(
0
)
{
if
(
$mydebug
)
{
echo
"<XMP>
\n
"
;
for
(
$i
=
0
;
$i
<
count
(
$output
);
$i
++
)
{
echo
"
$output[$i]
\n
"
;
...
...
@@ -179,32 +206,22 @@ if (0) {
# Make sure the report file exists, just to be safe!
#
if
(
!
file_exists
(
$repname
))
{
if
(
file_exists
(
$nsname
))
unlink
(
"
$nsname
"
);
if
(
file_exists
(
$irname
))
unlink
(
"
$irname
"
);
if
(
file_exists
(
$logname
))
unlink
(
"
$logname
"
);
if
(
file_exists
(
$assname
))
unlink
(
"
$assname
"
);
if
(
file_exists
(
$dirname
))
rmdir
(
"
$dirname
"
);
TBERROR
(
"Report file for new experiment does not exist!
\n
"
,
1
);
}
$query_result
=
mysql_db_query
(
$TBDBNAME
,
"DELETE FROM experiments WHERE eid='
$exp_id
' and pid=
\"
$exp_pid
\"
"
);
#
# So, that went okay. At this point enter the exp_id into the database
# so that it shows up as valid.
#
$query_result
=
mysql_db_query
(
$TBDBNAME
,
"INSERT INTO experiments "
.
"(eid, pid, expt_created, expt_expires, expt_name, "
.
"expt_head_uid, expt_start, expt_end) "
.
"VALUES ('
$exp_id
', '
$exp_pid
', '
$exp_created
', '
$exp_expires
', "
.
"'
$exp_name
', '
$uid
', '
$exp_start
', '
$exp_end
')"
);
if
(
!
$query_result
)
{
$err
=
mysql_error
();
TBERROR
(
"
Database Error adding new experiment
$exp_id
:
$err
\n
"
,
1
);
if
(
!
$mydebug
)
{
if
(
file_exists
(
$nsname
))
unlink
(
"
$nsname
"
);
if
(
file_exists
(
$irname
))
unlink
(
"
$irname
"
);
if
(
file_exists
(
$logname
))
unlink
(
"
$logname
"
);
if
(
file_exists
(
$assname
))
unlink
(
"
$assname
"
);
if
(
file_exists
(
$dirname
))
rmdir
(
"
$dirname
"
);
}
TBERROR
(
"
Report file for new experiment does not exist!
\n
"
,
1
);
}
echo
"<center><br>"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment